SPB Git

Repository Public

LegalPage.tsx 6.0 KB 119 lines tsx

1/**2 * =============================================================================3 *                  SP BOUCHER | SOFTWARE & RESEARCH4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : ORIX App Universe8 * File             : src/components/legal/LegalPage.tsx9 * Module           : components10 * Repository       : https://git.spboucher.ai/orix-spboucher-ai11 * Project Website  : https://www.orixlab.dev12 * Created          : 2026-11-2513 * Last Modified    : 2026-11-2514 *15 * Author           : Simon-Pierre Boucher16 * Position         : Professor of Finance17 * Institution      : Université du Québec en Outaouais (UQO)18 * Organization     : SP Boucher19 * Website          : https://spboucher.ai20 * Git              : https://git.spboucher.ai21 *22 * Preferred Contact: support@spboucher.ai23 * Development      : dev@spboucher.ai24 * Support          : support@spboucher.ai25 * Security/Admin   : admin@spboucher.ai26 *27 * Copyright (c) 202628 * Simon-Pierre Boucher29 * All rights reserved where applicable. This file is governed by the30 * applicable project license, copyright notices and relevant law.31 * Existing third-party rights and notices remain unaffected.32 *33 * License          : None specified (no license file in this repository)34 *35 * Do not embed credentials, private keys, access tokens,36 * certificates or confidential personal information.37 *38 * =============================================================================39 * END OF SP BOUCHER SOURCE HEADER40 * =============================================================================41 */4243import Link from "next/link";44import { Reveal } from "@/components/ui/Reveal";45import { Starfield } from "@/components/hero/Starfield";46import { fmtDate, href, type Locale } from "@/lib/i18n";47import { LEGAL_EFFECTIVE, LEGAL_LABELS, legalContacts, legalDoc } from "@/lib/legal";4849/** Turns the e-mail addresses written in a paragraph into links; everything else stays plain text. */50function Text({ children }: { children: string }) {51  const parts = children.split(/([a-z]+@spboucher\.ai)/g);52  return <>{parts.map((p, i) => (/^[a-z]+@spboucher\.ai$/.test(p) ? <a key={i} className="link" href={`mailto:${p}`}>{p}</a> : p))}</>;53}5455/** A legal document: summary, table of contents, numbered sections, and the addresses to write to. */56export function LegalPage({ kind, locale }: { kind: "privacy" | "terms"; locale: Locale }) {57  const doc = legalDoc(kind, locale), l = LEGAL_LABELS[locale], contacts = legalContacts(locale);58  const other = kind === "privacy" ? { path: "/terms", label: l.terms } : { path: "/privacy", label: l.privacy };59  return (60    <article data-testid={`legal-${kind}`}>61      <header className="relative isolate overflow-hidden pb-14 pt-32 sm:pt-40">62        <Starfield density={0.5} className="-z-10" /><div className="gridlines -z-10" aria-hidden />63        <div className="wrap">64          <p className="eyebrow">ORIX · {l.publisher}: Simon-Pierre Boucher</p>65          <h1 className="h1 mt-5">{doc.title}</h1>66          <p className="lead mt-5">{doc.lead}</p>67          <p className="mono mt-7 text-[0.78rem] uppercase tracking-[0.12em] text-ink3" data-testid="legal-date">{l.effective} {fmtDate(LEGAL_EFFECTIVE, locale)}</p>68        </div>69      </header>7071      <div className="wrap grid gap-x-14 gap-y-10 pb-10 lg:grid-cols-[17rem_minmax(0,1fr)]">72        <nav aria-label={l.contents} className="lg:sticky lg:top-24 lg:max-h-[calc(100vh-7rem)] lg:self-start lg:overflow-y-auto">73          <h2 className="eyebrow">{l.contents}</h2>74          <ol className="mt-4 grid gap-1.5 text-[0.88rem]">75            {doc.sections.map((s) => <li key={s.id}><a className="text-ink2 hover:text-ink" href={`#${s.id}`}>{s.title}</a></li>)}76          </ol>77          <p className="mt-6 text-[0.88rem]"><span className="text-ink3">{l.other} · </span><Link className="link" href={href(locale, other.path)}>{other.label}</Link></p>78        </nav>7980        <div className="min-w-0 max-w-3xl">81          <Reveal>82            <div className="card p-6 sm:p-8">83              <h2 className="h3">{doc.summaryTitle}</h2>84              <ul className="mt-4 grid gap-2.5 text-ink2">85                {doc.summary.map((s, i) => <li key={i} className="flex gap-3"><span className="mono beam-text shrink-0 text-[0.8rem] font-semibold leading-[1.9]">0{i + 1}</span><span><Text>{s}</Text></span></li>)}86              </ul>87            </div>88          </Reveal>8990          {doc.sections.map((s) => (91            <section key={s.id} id={s.id} className="border-b border-line py-9" aria-labelledby={`${s.id}-title`}>92              <h2 id={`${s.id}-title`} className="h3 !text-[1.45rem]">{s.title}</h2>93              <div className="prose mt-4 text-ink2">94                {s.body.map((p, i) => <p key={i}><Text>{p}</Text></p>)}95                {s.list && <ul className="mt-4 grid gap-3">{s.list.map((p, i) => <li key={i} className="flex gap-3"><span aria-hidden className="mt-[0.7em] h-1.5 w-1.5 shrink-0 rounded-full" style={{ background: "var(--beam)" }} /><span><Text>{p}</Text></span></li>)}</ul>}96                {s.after?.map((p, i) => <p key={`a${i}`} className="mt-4"><Text>{p}</Text></p>)}97              </div>98            </section>99          ))}100101          <section className="py-10" aria-labelledby="legal-contacts">102            <h2 id="legal-contacts" className="h3 !text-[1.45rem]">{l.contactsTitle}</h2>103            <p className="mt-2 text-ink2">{l.publisherLine}</p>104            <ul className="mt-6 grid gap-4 sm:grid-cols-2" data-testid="legal-contacts">105              {contacts.map((c) => (106                <li key={c.address} className="card p-5">107                  <p className="eyebrow">{c.role}</p>108                  <p className="mt-3"><a className="link mono text-[0.95rem] font-semibold" href={`mailto:${c.address}`}>{c.address}</a></p>109                  <p className="mt-2 text-[0.9rem] text-ink2">{c.use}</p>110                </li>111              ))}112            </ul>113          </section>114        </div>115      </div>116    </article>117  );118}119
Files main
Menu

Theme