import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { Container } from "@/components/atoms/Container"; import { Section } from "@/components/atoms/Section"; import { PageHero } from "@/components/molecules/PageHero"; import { getLegalPage } from "@/lib/data/site"; type Props = { params: Promise<{ slug: string }> }; const ALLOWED = new Set(["privacy", "accessibility", "press", "careers"]); export async function generateStaticParams() { return [...ALLOWED].map((slug) => ({ slug })); } export async function generateMetadata({ params }: Props): Promise { const { slug } = await params; const page = await getLegalPage(slug); if (!page) return { title: "صفحه یافت نشد" }; return { title: page.title, description: page.body[0] }; } export default async function LegalSlugPage({ params }: Props) { const { slug } = await params; if (!ALLOWED.has(slug)) notFound(); const page = await getLegalPage(slug); if (!page) notFound(); return (
{page.body.map((paragraph) => (

{paragraph}

))}
); }