import { notFound } from 'next/navigation'
import { Footer } from '@/components/Footer'
import { Header } from '@/components/Header'
import { PrivacyNote } from '@/components/PrivacyNote'
import { Tbc } from '@/components/Tbc'
import { getDict, isLocale } from '@/i18n'
import { loadContent } from '@/lib/content'
import { buildHomeModel, bookUrl, type Card } from '@/lib/home-model'
export const dynamic = 'force-dynamic'
function Cards({ items, tbc }: { items: Card[]; tbc: string }) {
return (
{items.map((c) => (
-
{c.title}
{c.tbc ? : c.text}
))}
)
}
const Section = ({ id, title, children }: { id: string; title: string; children: React.ReactNode }) => (
)
export default async function Home({ params }: { params: Promise<{ locale: string }> }) {
const { locale } = await params
if (!isLocale(locale)) notFound()
const t = getDict(locale)
const { home, news } = await loadContent(locale)
const m = buildHomeModel(home, news, t)
const fmt = new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'long', year: 'numeric' })
return (
<>
0} />
{m.mission.text}
{m.mission.tbc &&
}
{t.book.author}
{t.book.title}
{t.book.paragraphs.map((text) =>
{text}
)}
{t.book.get}
{m.projects.length > 0 &&
}
{m.news.length > 0 && (
{m.news.map((n) => (
-
{n.kind === 'event' ? t.news.event : t.news.news}
{n.title}
{n.summary &&
{n.summary}
}
{n.place &&
{n.place}
}
))}
)}
{t.collaboration.title}
{m.collaboration.text}
{m.collaboration.email ? (
{m.collaboration.email}
) : (
{t.tbc}: {t.collaboration.contactMissing}
)}
>
)
}