feat: add privacy hub and application privacy subpages
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
import { notFound } from "next/navigation";
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import { i18n, type Locale } from "@/i18n-config";
|
||||
import PrivacyDetailClient from "@/components/PrivacyDetailClient";
|
||||
import { getAllPrivacyApps, getPrivacyAppBySlug } from "@/data/privacy";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const paths: Array<{ lang: Locale; slug: string }> = [];
|
||||
const apps = getAllPrivacyApps();
|
||||
|
||||
for (const lang of i18n.locales) {
|
||||
for (const app of apps) {
|
||||
paths.push({ lang, slug: app.slug });
|
||||
}
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: Locale; slug: string }>;
|
||||
}) {
|
||||
const { lang, slug } = await params;
|
||||
const app = getPrivacyAppBySlug(slug);
|
||||
|
||||
if (!app) {
|
||||
return {
|
||||
title: lang === "tr" ? "Gizlilik Politikası Bulunamadı" : "Privacy Policy Not Found",
|
||||
};
|
||||
}
|
||||
|
||||
const isTr = lang === "tr";
|
||||
|
||||
return {
|
||||
title: isTr
|
||||
? `${app.name} Gizlilik Politikası & Veri Güvenliği | Ayris Tech`
|
||||
: `${app.name} Privacy Policy & Data Security | Ayris Tech`,
|
||||
description: app.summary[lang],
|
||||
alternates: {
|
||||
canonical: `/${lang}/privacy/${app.slug}`,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default async function PrivacyDetailPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: Locale; slug: string }>;
|
||||
}) {
|
||||
const { lang, slug } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
const app = getPrivacyAppBySlug(slug);
|
||||
|
||||
if (!app) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
const allApps = getAllPrivacyApps();
|
||||
const otherApps = allApps.filter((a) => a.slug !== app.slug);
|
||||
|
||||
return (
|
||||
<PrivacyDetailClient
|
||||
lang={lang}
|
||||
dict={dict}
|
||||
app={app}
|
||||
otherApps={otherApps}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
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} />;
|
||||
}
|
||||
Reference in New Issue
Block a user