import { notFound } from 'next/navigation' import { SectionPage } from '@/components/SectionPage' import { getDict, isLocale, locales } from '@/i18n' import { loadContent, loadLegal, loadProject } from '@/lib/content' import { mediaOf, paragraphs } from '@/lib/site-model' export const dynamic = 'force-dynamic' type Props = { params: Promise<{ locale: string; slug: string }> } export async function generateMetadata({ params }: Props) { const { locale, slug } = await params if (!isLocale(locale)) notFound() const p = await loadProject(locale, slug) if (!p?.title?.trim()) notFound() return { title: `${p.title} — ${getDict(locale).siteName}`, description: p.summary || p.title, alternates: { languages: Object.fromEntries(locales.map((l) => [l, `/${l}/projects/${slug}`])) } } } export default async function Page({ params }: Props) { const { locale, slug } = await params if (!isLocale(locale)) notFound() const t = getDict(locale) const p = await loadProject(locale, slug) // Проект без названия на языке страницы не показываем. if (!p?.title?.trim()) notFound() const { news } = await loadContent(locale) const cover = mediaOf(p.cover) return ( 0}>
{/* eslint-disable-next-line @next/next/no-img-element -- загруженные сотрудниками фото отдаёт Payload */} {cover && {cover.alt}} {paragraphs([p.summary, p.body].filter(Boolean).join('\n\n')).map((text) =>

{text}

)}
) }