qazaq-legacy-foundation-web/src/app/(site)/[locale]/about/page.tsx
Peppa 1a58c2a4d9
All checks were successful
peppa/lint lint: success за 1с
peppa/typecheck typecheck: success за 2с
peppa/test test: success за 1с
peppa/build build: success за 41с
ci / checks (pull_request) Successful in 1m22s
deploy / deploy (pull_request) Successful in 17s
QLFW-6: панель управления: проекты, фото, контакты и текст «О фонде»
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 23:33:54 +05:00

49 lines
3.5 KiB
TypeScript

import { notFound } from 'next/navigation'
import { getDict, isLocale, locales } from '@/i18n'
import { loadAbout, loadContent, loadFoundation, loadLegal } from '@/lib/content'
import { mediaOf, paragraphs } from '@/lib/site-model'
import { buildHomeModel } from '@/lib/home-model'
import { SectionPage } from '@/components/SectionPage'
import { aboutPeople } from '@/lib/about-model'
import { buildFoundationPeople } from '@/lib/foundation-people'
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.sections.about} — ${t.siteName}`, description: t.metaDescription, alternates: { languages: Object.fromEntries(locales.map(l => [l, `/${l}/about`])) } }
}
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 data = aboutPeople[locale]
const people = buildFoundationPeople(await loadFoundation())
const about = await loadAbout(locale)
const aboutText = paragraphs(about?.text)
const aboutPhoto = mediaOf(about?.photo)
return <SectionPage legal={await loadLegal(locale)} t={t} locale={locale} path="/about" title={t.sections.about} showNews={m.news.length > 0}>
{aboutText.length > 0 && <section className="mb-12 max-w-3xl">
{/* eslint-disable-next-line @next/next/no-img-element -- загруженные сотрудниками фото отдаёт Payload */}
{aboutPhoto && <img src={aboutPhoto.url} alt={aboutPhoto.alt} className="mb-6 h-auto w-full" />}
{aboutText.map((text) => <p key={text} className="mt-4 text-lg leading-relaxed">{text}</p>)}
</section>}
<section><h2 className="font-serif text-2xl">{t.mission.title}</h2><p className="mt-4 max-w-3xl text-lg">{m.mission.text}</p></section>
<section className="mt-12"><h2 className="font-serif text-2xl">{t.sections.goals}</h2><p className="mt-4 max-w-3xl">{t.sections.goalText}</p></section>
<section id="directions" className="mt-12 scroll-mt-8"><h2 className="font-serif text-2xl">{t.directions.title}</h2>
<ul className="mt-6 grid gap-6 sm:grid-cols-2">{m.directions.map(d => <li key={d.title} className="border border-line p-6"><h3 className="font-serif text-xl">{d.title}</h3><p className="mt-3">{d.text}</p></li>)}</ul>
</section>
<div className="mt-12 grid gap-8 sm:grid-cols-3">
<section id="founder"><h2 className="mb-4 font-serif text-2xl">{t.sections.founder}</h2><p>{people.founder}</p></section>
<section id="leadership"><h2 className="mb-4 font-serif text-2xl">{t.sections.leadership}</h2><p className="text-sm text-graphite">{t.sections.director}</p><p>{people.director}</p></section>
<section id="board"><h2 className="mb-4 font-serif text-2xl">{t.sections.board}</h2>
<ul className="space-y-3">{people.board.map(b => <li key={b.name}><p className="text-sm text-graphite">{b.role === 'chair' ? t.sections.chair : t.sections.boardMember}</p><p>{b.name}</p></li>)}</ul>
</section>
</div>
{data.partners.length > 0 && <section className="mt-12"><h2 className="font-serif text-2xl">{t.sections.partners}</h2><ul className="mt-4 space-y-2">{data.partners.map(p => <li key={p.name}>{p.url ? <a className="underline" href={p.url}>{p.name}</a> : p.name}</li>)}</ul></section>}
</SectionPage>
}