import { imgUrl } from '../../api.js'; import { BY_CODE, countryName, fmtRange } from './laender.js'; // Zeitleiste "Wann war ich wo?": alle Besuche, neueste zuerst, nach Jahren gruppiert export default function Timeline({ visits, cities, onSelectCity, onEdit, onPhoto }) { if (!visits.length) { return
Noch keine Besuche. Klick auf eine Stadt und dann auf „+ Besuch eintragen“.
; } const byId = new Map(cities.map((c) => [c.id, c])); const years = []; for (const v of visits) { const year = v.dateFrom.slice(0, 4); if (years.at(-1)?.year !== year) years.push({ year, visits: [] }); years.at(-1).visits.push(v); } return ({v.notes}
} {v.photos.length > 0 && (