| 1 | /* 法务页(/privacy、/terms):登录页页脚可达的公共页面。 |
| 2 | 自部署语境:运营方是部署它的组织,这里的文本是随软件附带的缺省政策, |
| 3 | 口径务求诚实(存了什么、什么情况下数据会离开服务器、删除的真实语义)。 */ |
| 4 | import { Link } from "@tanstack/react-router"; |
| 5 | import { S } from "../i18n"; |
| 6 | |
| 7 | type LegalSection = { |
| 8 | h: string; |
| 9 | body: readonly string[]; |
| 10 | bullets?: readonly string[]; |
| 11 | }; |
| 12 | type LegalDocData = { |
| 13 | title: string; |
| 14 | note: string; |
| 15 | sections: readonly LegalSection[]; |
| 16 | }; |
| 17 | |
| 18 | function LegalPage({ doc }: { doc: LegalDocData }) { |
| 19 | return ( |
| 20 | <div className="min-h-screen px-4 py-14"> |
| 21 | <div className="mx-auto w-full max-w-xl"> |
| 22 | <Link |
| 23 | to="/login" |
| 24 | className="text-xs text-neutral-500 hover:text-neutral-300 transition-colors" |
| 25 | > |
| 26 | {S.legal.backToSignIn} |
| 27 | </Link> |
| 28 | <h1 |
| 29 | className="mt-6 text-3xl text-white" |
| 30 | style={{ fontFamily: "var(--font-brand)", letterSpacing: "0.04em" }} |
| 31 | > |
| 32 | {doc.title} |
| 33 | </h1> |
| 34 | <p className="mt-3 text-xs text-neutral-600">{doc.note}</p> |
| 35 | <div className="mt-9 space-y-7"> |
| 36 | {doc.sections.map((s) => ( |
| 37 | <section key={s.h}> |
| 38 | <h2 className="text-sm font-semibold text-neutral-200">{s.h}</h2> |
| 39 | {s.body.map((p, i) => ( |
| 40 | <p key={i} className="mt-2 text-sm leading-relaxed text-neutral-400"> |
| 41 | {p} |
| 42 | </p> |
| 43 | ))} |
| 44 | {s.bullets && ( |
| 45 | <ul className="mt-2 space-y-1.5"> |
| 46 | {s.bullets.map((b, i) => ( |
| 47 | <li |
| 48 | key={i} |
| 49 | className="relative pl-4 text-sm leading-relaxed text-neutral-400" |
| 50 | > |
| 51 | <span className="absolute left-0 text-neutral-600">–</span> |
| 52 | {b} |
| 53 | </li> |
| 54 | ))} |
| 55 | </ul> |
| 56 | )} |
| 57 | </section> |
| 58 | ))} |
| 59 | </div> |
| 60 | </div> |
| 61 | </div> |
| 62 | ); |
| 63 | } |
| 64 | |
| 65 | export function Privacy() { |
| 66 | return <LegalPage doc={S.legal.privacy} />; |
| 67 | } |
| 68 | export function Terms() { |
| 69 | return <LegalPage doc={S.legal.terms} />; |
| 70 | } |