import { getDictionary } from "@/get-dictionary";
import type { Locale } from "@/i18n-config";
import PrivacyClient from "@/components/PrivacyClient";
import { getAllPrivacyApps } from "@/data/privacy";

export async function generateMetadata({
  params,
}: {
  params: Promise<{ lang: Locale }>;
}) {
  const { lang } = await params;
  const dict = await getDictionary(lang);
  const isTr = lang === "tr";

  return {
    title: isTr
      ? "Gizlilik Politikaları & Veri Güvenliği | Ayris Tech"
      : "Privacy Policies & Data Compliance | Ayris Tech",
    description: isTr
      ? "Ayris Tech mobil uygulamaları, bulut servisleri ve web platformlarının şeffaf gizlilik politikaları, KVKK ve GDPR uyum ilkeleri."
      : "Transparent privacy policies, hardware permissions, and data protection compliance for all Ayris Tech applications and cloud services.",
    alternates: {
      canonical: `/${lang}/privacy`,
    },
  };
}

export default async function PrivacyPage({
  params,
}: {
  params: Promise<{ lang: Locale }>;
}) {
  const { lang } = await params;
  const dict = await getDictionary(lang);
  const apps = getAllPrivacyApps();

  return <PrivacyClient lang={lang} dict={dict} apps={apps} />;
}
