import { notFound } from 'next/navigation' import { getDict, isLocale, locales } from '@/i18n' import { loadContent, loadLegal, loadProjects, loadSettings } from '@/lib/content' import { bookPhotoList, mediaOf, visibleProjects } from '@/lib/site-model' import { buildHomeModel } from '@/lib/home-model' import { PhotoGallery } from '@/components/PhotoGallery' import { SectionPage } from '@/components/SectionPage' import Image from 'next/image' import Link from 'next/link' 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.projects.title} — ${t.siteName}`, description: t.metaDescription, alternates: { languages: Object.fromEntries(locales.map(l => [l, `/${l}/projects`])) } } } export default async function Page({ 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 projects = visibleProjects(await loadProjects(locale)) const base = [1, 2, 3, 4].map(n => ({ src: `/books/serkebayev/photo-${n}.jpg` })) const photos = bookPhotoList(await loadSettings(locale), base).map((p, i) => ({ src: p.src, alt: `${t.book.photo} ${i + 1}` })) return 0}>
{`${t.book.cover}:

{t.book.author}

{t.book.title}

{t.book.paragraphs.map(text =>

{text}

)}{t.projects.more}
{projects.length > 0 && }
}