/** * Map page — server component shell for the interactive map. * Loads Leaflet CSS, renders the MapView client component. */ import { getConfig } from '@/lib/config'; import { isListedSubpage, listedAlbumIds } from '@/lib/config/schema'; import { notFound } from 'next/navigation'; import { MapView } from '@/components/MapView'; import { BackLink } from '@/components/BackLink'; import type { Metadata } from 'next'; import { getServerDictionary } from '@/lib/i18n/server'; // Imported here as well as in LeafletMap: this page has the stylesheet in its // server HTML, so the tiles never render before their CSS. import 'leaflet/dist/leaflet.css'; import './map.css'; export const dynamic = 'force-dynamic'; export function generateMetadata(): Metadata { return { title: getServerDictionary().map.title }; } export default function MapPage() { const config = getConfig(); const t = getServerDictionary(); if (!config.map) { notFound(); } // Counts what the map may show: a hidden subpage is reachable by direct // link only, so neither it nor an album only it carries is counted. const collectionCount = config.subpages.filter(isListedSubpage).length; const albumCount = listedAlbumIds(config).size; return ( <>

{t.map.title}

{t.map.subtitle}

); }