| 1 | import { StatusBadge } from "@/components/status-badge"; |
| 2 | import { |
| 3 | ADVISORY_ROLE, |
| 4 | CONTROL_MODES, |
| 5 | MEASUREMENT_PRINCIPLES, |
| 6 | PERMISSION_POSTURES, |
| 7 | PRODUCT_TERMS, |
| 8 | ROUTE_IDENTITY, |
| 9 | } from "@/lib/content/vocabulary"; |
| 10 | import { getDocsVocabulary, pickText } from "@/lib/i18n/dictionaries"; |
| 11 | import { buildPageMetadata } from "@/lib/page-meta"; |
| 12 | |
| 13 | export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }) { |
| 14 | const { locale } = await params; |
| 15 | const t = getDocsVocabulary(locale); |
| 16 | return buildPageMetadata({ |
| 17 | path: "/docs/vocabulary", |
| 18 | locale, |
| 19 | title: t.metaTitle, |
| 20 | description: t.metaDescription, |
| 21 | }); |
| 22 | } |
| 23 | |
| 24 | export default async function VocabularyPage({ params }: { params: Promise<{ locale: string }> }) { |
| 25 | const { locale } = await params; |
| 26 | const t = getDocsVocabulary(locale); |
| 27 | |
| 28 | return ( |
| 29 | <section className="space-y-10"> |
| 30 | <section id="overview" className="scroll-mt-32"> |
| 31 | <h1 className="font-display text-3xl mb-1">{t.title}</h1> |
| 32 | <p className={`${t.bodyClassName} mt-3`}> |
| 33 | {t.lead} |
| 34 | </p> |
| 35 | </section> |
| 36 | |
| 37 | <section id="execution-nouns" className="scroll-mt-32"> |
| 38 | <h2 className="font-display text-2xl mb-1"> |
| 39 | {t.executionHeading} |
| 40 | </h2> |
| 41 | <div className="hairline-t mt-4"> |
| 42 | {PRODUCT_TERMS.map((row) => ( |
| 43 | <section key={row.term} className="py-4 hairline-b"> |
| 44 | <h3 className="font-display text-xl"> |
| 45 | {row.term}{" "} |
| 46 | <span className="text-sm text-ink-mute font-normal"> |
| 47 | = {pickText(row.short, locale)} |
| 48 | </span> |
| 49 | </h3> |
| 50 | <p className={`${t.bodyClassName} mt-1 text-sm`}>{pickText(row.long, locale)}</p> |
| 51 | </section> |
| 52 | ))} |
| 53 | </div> |
| 54 | </section> |
| 55 | |
| 56 | <section id="control-nouns" className="scroll-mt-32"> |
| 57 | <h2 className="font-display text-2xl mb-1"> |
| 58 | {t.controlHeading} |
| 59 | </h2> |
| 60 | <p className={`${t.bodyClassName} mt-3`}> |
| 61 | {t.controlLead} |
| 62 | </p> |
| 63 | <div className="hairline-t mt-4"> |
| 64 | {[...CONTROL_MODES, ...PERMISSION_POSTURES].map((row) => ( |
| 65 | <section key={row.term} className="py-4 hairline-b"> |
| 66 | <h3 className="font-display text-xl">{row.term}</h3> |
| 67 | <p className={`${t.bodyClassName} mt-1 text-sm`}> |
| 68 | {pickText(row.description, locale)} |
| 69 | </p> |
| 70 | </section> |
| 71 | ))} |
| 72 | </div> |
| 73 | </section> |
| 74 | |
| 75 | <section id="route-identity" className="scroll-mt-32"> |
| 76 | <h2 className="font-display text-2xl mb-1"> |
| 77 | {t.routeHeading} |
| 78 | </h2> |
| 79 | <div className="hairline-t mt-4"> |
| 80 | {ROUTE_IDENTITY.map((row) => ( |
| 81 | <section key={row.term} className="py-4 hairline-b"> |
| 82 | <h3 className="font-display text-xl">{row.term}</h3> |
| 83 | <p className={`${t.bodyClassName} mt-1 text-sm`}> |
| 84 | {pickText(row.description, locale)} |
| 85 | </p> |
| 86 | </section> |
| 87 | ))} |
| 88 | </div> |
| 89 | </section> |
| 90 | |
| 91 | <section id="advisory-role" className="scroll-mt-32"> |
| 92 | <h2 className="font-display text-2xl mb-1"> |
| 93 | {t.advisoryHeading} |
| 94 | </h2> |
| 95 | <div className="hairline-t mt-4 py-4 hairline-b"> |
| 96 | <h3 className="font-display text-xl">{ADVISORY_ROLE.term}</h3> |
| 97 | <p className={`${t.bodyClassName} mt-1 text-sm`}> |
| 98 | {pickText(ADVISORY_ROLE.description, locale)} |
| 99 | </p> |
| 100 | </div> |
| 101 | </section> |
| 102 | |
| 103 | <section id="measurement" className="scroll-mt-32"> |
| 104 | <h2 className="font-display text-2xl mb-1"> |
| 105 | {t.measurementHeading} |
| 106 | </h2> |
| 107 | <ul className="mt-4 space-y-3"> |
| 108 | {MEASUREMENT_PRINCIPLES.map((principle) => ( |
| 109 | <li key={principle.en} className={`${t.bodyClassName} text-sm`}> |
| 110 | {pickText(principle, locale)} |
| 111 | </li> |
| 112 | ))} |
| 113 | </ul> |
| 114 | <p className={`${t.bodyClassName} mt-4 text-sm`}> |
| 115 | <StatusBadge kind="unavailable" locale={locale} />{" "} |
| 116 | {t.leaderboardNote} |
| 117 | </p> |
| 118 | </section> |
| 119 | |
| 120 | {/* Maintainer pointer: kept out of the rendered copy (experience mark 5). */} |
| 121 | <div hidden data-source-note={t.sourceNote} /> |
| 122 | </section> |
| 123 | ); |
| 124 | } |
| 125 |