import { Converter } from "showdown"; import l from "./locales"; let converter = new Converter(); export function countryPopup(country, properties) { return `
${img(country.img)} ${title(country.name)}
${JSON.parse(properties.tags || "[]").join(", ")}
${l("founded")}: ${new Date(country.date).toLocaleDateString()}
${ country.description ? `
${converter.makeHtml(country.description)}
` : "" }
${l("area")}: ${properties.area} ${l("km")}²
${ country.about ? `${l("about")}` : "" }
`; } function img(url) { return `
`; } function title(name) { return `
${name}
`; } export function markerPopup(properties) { return ` ${ properties?.amount ? `
${l( "population" )} - ${properties.amount} ${l("people")}.
` : "" }
${properties?.img ? img(properties.img) : ""} ${title( `${properties.name} ${ properties.translated_name ? `- ${properties.translated_name}` : "" }` )} ${ properties.description ? `
${converter.makeHtml( properties.description )}
` : "" }
`; }