19 lines
822 B
TypeScript
19 lines
822 B
TypeScript
import type { Metadata } from "next";
|
|
import { notFound } from "next/navigation";
|
|
import LegalDocument from "@/components/public/legal-document";
|
|
import { getActiveLocale, isLocale, type Locale } from "@/lib/i18n";
|
|
import { getLegalDocument } from "@/lib/legal-content";
|
|
|
|
type LegalPageProps = { params: { locale: string } };
|
|
|
|
export function generateMetadata({ params }: LegalPageProps): Metadata {
|
|
if (!isLocale(params.locale)) return {};
|
|
const document = getLegalDocument(getActiveLocale(params.locale as Locale), "privacy");
|
|
return { title: document.title, description: document.intro };
|
|
}
|
|
|
|
export default function PrivacyPage({ params }: LegalPageProps) {
|
|
if (!isLocale(params.locale)) notFound();
|
|
return <LegalDocument document={getLegalDocument(getActiveLocale(params.locale as Locale), "privacy")} />;
|
|
}
|