import { Section } from "@/components/Section";
import { StructuredData } from "@/components/StructuredData";
import { getT } from "@/lib/content";
import type { Locale } from "@/lib/locales";

import PrivacyEn from "@/content/legal/privacy.en.mdx";
import PrivacyMk from "@/content/legal/privacy.mk.mdx";
import PrivacySq from "@/content/legal/privacy.sq.mdx";
import PrivacyTr from "@/content/legal/privacy.tr.mdx";

import styles from "./Page.module.css";
import { PageTitle } from "./PageTitle";

/**
 * /privatesia — the privacy notice, authored as MDX because it is genuine
 * prose rather than structured data. Required once a form exists (Audit v1).
 *
 * Drafted by RRYM and still to be reviewed by Kujto; it is not legal advice.
 */
const NOTICES: Record<Locale, typeof PrivacySq> = {
  sq: PrivacySq,
  mk: PrivacyMk,
  tr: PrivacyTr,
  en: PrivacyEn,
};

export function PrivacyView({ locale }: { locale: Locale }) {
  const t = getT(locale);
  const Notice = NOTICES[locale];

  return (
    <>
      <StructuredData
        locale={locale}
        crumbs={[
          { name: t("nav.home"), target: { key: "home" } },
          { name: t("form.privacyLink"), target: { key: "privacy" } },
        ]}
      />

      <PageTitle title={t("form.privacyLink")} />

      <Section label={t("label.privacy")}>
        <div className={styles.mdx}>
          <Notice />
        </div>
      </Section>
    </>
  );
}
