| 1 | import Link from "next/link"; |
| 2 | import { LegalTabs } from "@/components/legal-tabs"; |
| 3 | import { PageHeader } from "@/components/page-header"; |
| 4 | import { UsagePreferenceControl } from "@/components/usage-counting"; |
| 5 | import { USAGE_COUNTING_COPY } from "@/lib/content/usage-counting"; |
| 6 | import { BUILD_FACTS } from "@/lib/facts"; |
| 7 | import { getChrome, getLegalPrivacy, pickText } from "@/lib/i18n/dictionaries"; |
| 8 | import { buildPageMetadata } from "@/lib/page-meta"; |
| 9 | import { formatLegalDocumentStatus, LEGAL_DOCUMENTS, PrivacyContent, WEBSITE_USAGE_DISCLOSURE } from "@/lib/legal-copy"; |
| 10 | |
| 11 | export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }) { |
| 12 | const { locale } = await params; |
| 13 | const t = getLegalPrivacy(locale); |
| 14 | return buildPageMetadata({ |
| 15 | path: "/legal/privacy", |
| 16 | locale, |
| 17 | title: t.metaTitle, |
| 18 | description: t.metaDescription, |
| 19 | }); |
| 20 | } |
| 21 | |
| 22 | export default async function PrivacyPage({ params }: { params: Promise<{ locale: string }> }) { |
| 23 | const { locale } = await params; |
| 24 | const t = getLegalPrivacy(locale); |
| 25 | return ( |
| 26 | <> |
| 27 | <PageHeader |
| 28 | kicker={t.kicker} |
| 29 | title={t.title} |
| 30 | meta={formatLegalDocumentStatus("privacy", getChrome(locale).dateLocale)} |
| 31 | /> |
| 32 | <div className="page-body"> |
| 33 | <div className="page-body-narrow"> |
| 34 | <LegalTabs locale={locale} current="privacy" /> |
| 35 | <article className="prose legal-doc [&>section>p+p]:mt-[var(--space-4)]" data-legal-version={LEGAL_DOCUMENTS.privacy.version} data-legal-status={LEGAL_DOCUMENTS.privacy.status} data-legal-effective-at={LEGAL_DOCUMENTS.privacy.effectiveAt ?? undefined}> |
| 36 | <PrivacyContent /> |
| 37 | <section> |
| 38 | <h2>{WEBSITE_USAGE_DISCLOSURE.title}</h2> |
| 39 | <p>{WEBSITE_USAGE_DISCLOSURE.body}</p> |
| 40 | </section> |
| 41 | <section id="usage-counting" className="scroll-mt-32"> |
| 42 | <h2>{pickText(USAGE_COUNTING_COPY.heading, locale)}</h2> |
| 43 | <UsagePreferenceControl locale={locale} appVersion={BUILD_FACTS.version ?? "0.0.0"} /> |
| 44 | </section> |
| 45 | <p className="status-line"> |
| 46 | <Link href={`/${locale}/legal/terms`} className="link">{t.termsLink}</Link> |
| 47 | <Link href={`/${locale}`} className="link">{t.homeLink}</Link> |
| 48 | </p> |
| 49 | </article> |
| 50 | </div> |
| 51 | </div> |
| 52 | </> |
| 53 | ); |
| 54 | } |
| 55 |