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