返回 CodeWhale
page.tsx
根目录 / web / app / [locale] / legal / privacy / page.tsx
1 import Link from "next/link";
2 import { UsagePreferenceControl } from "@/components/usage-counting";
3 import { USAGE_COUNTING_COPY } from "@/lib/content/usage-counting";
4 import { BUILD_FACTS } from "@/lib/facts";
5 import { pickText } from "@/lib/i18n/dictionaries";
6 import { buildPageMetadata } from "@/lib/page-meta";
7 import { LEGAL_UPDATED, PRIVACY_SECTIONS } from "@/lib/legal-copy";
8
9 export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }) {
10 const { locale } = await params;
11 const isZh = locale === "zh";
12 return buildPageMetadata({
13 path: "/legal/privacy",
14 locale,
15 title: isZh ? "隐私政策 · Codewhale" : "Privacy policy · Codewhale",
16 description: isZh
17 ? "Shannon Labs 如何在你使用 Codewhale 时处理信息。"
18 : "How Shannon Labs handles information when you use Codewhale.",
19 });
20 }
21
22 export default async function PrivacyPage({ params }: { params: Promise<{ locale: string }> }) {
23 const { locale } = await params;
24 const isZh = locale === "zh";
25 return (
26 <div className="portal-home">
27 <article className="legal-doc">
28 <p className="legal-doc-kicker">{isZh ? "法律" : "Legal"}</p>
29 <h1>{isZh ? "隐私政策" : "Privacy policy"}</h1>
30 <p className="legal-doc-updated">
31 {isZh ? "生效并最近更新于" : "Effective and last updated"} {LEGAL_UPDATED}
32 {isZh ? "。以下为具有约束力的英文文本。" : "."}
33 </p>
34 <p>This policy explains how Shannon Labs handles information when you use Codewhale.</p>
35 {PRIVACY_SECTIONS.map((section) => (
36 <section key={section.title}>
37 <h2>{section.title}</h2>
38 <p>{section.body}</p>
39 </section>
40 ))}
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="legal-doc-nav">
46 <Link href={`/${locale}/legal/terms`}>{isZh ? "服务条款" : "Terms of service"}</Link>
47 <Link href={`/${locale}`}>{isZh ? "返回首页" : "Back home"}</Link>
48 </p>
49 </article>
50 </div>
51 );
52 }
53
53 lines Plain Text