"use client" import Image from "next/image" import Link from "next/link" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { useAppLocale, useI18n } from "@/i18n/provider" import enUSMessages from "@/messages/en-US.json" import zhCNMessages from "@/messages/zh-CN.json" type LegalPageType = "terms" | "privacy" type LegalSection = { title: string body: string } type LegalDocument = { title: string description: string updatedAt: string relatedLabel: string relatedLink: string sections: LegalSection[] } const messages = { "zh-CN": zhCNMessages, "en-US": enUSMessages, } export function LegalDocumentPage({ type }: { type: LegalPageType }) { const t = useI18n() const { locale } = useAppLocale() const document = messages[locale].legal[type] as LegalDocument const relatedHref = type === "terms" ? "/legal/privacy" : "/legal/terms" return (
{t("app.brand")} {t("app.brand")}
{document.title}

{document.description}

{document.updatedAt}

{document.sections.map((section) => (

{section.title}

{section.body}

))}
) }