import Link from 'next/link' import { notFound } from 'next/navigation' import { getDict, isLocale, locales } from '@/i18n' import { loadNews } from '@/lib/content' import { visibleNews } from '@/lib/news-model' import { SectionPage } from '@/components/SectionPage' export const dynamic = 'force-dynamic' export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }) { const { locale } = await params if (!isLocale(locale)) notFound() const t = getDict(locale) return { title: `${t.news.title} — ${t.siteName}`, description: t.metaDescription, alternates: { languages: Object.fromEntries(locales.map(l => [l, `/${l}/news`])) } } } export default async function Page({ params }: { params: Promise<{ locale: string }> }) { const { locale } = await params if (!isLocale(locale)) notFound() const t = getDict(locale) const news = visibleNews(await loadNews(locale)) if (!news.length) notFound() const fmt = new Intl.DateTimeFormat(locale, { dateStyle: 'long' }) return }