User: "quero que o usuário possa escolher o idioma na navbar, e então leia
o site todo em seu idioma."
The locale infrastructure already existed (cookie + getLocale() + every
page renders bilingual). The toggle only lived as a subtle floating
control bottom-left. This surfaces it in the navbars where users expect
it, and confirms whole-site language switching.
locale-toggle-client.tsx
- New variant="navbar": gold-amber pill matching the magazine theme
(PT | EN, active = solid gold). Retro green variant kept for the
floating fallback.
- Guard: clicking the already-active language is a no-op.
- aria-pressed on each button for a11y.
locale-toggle.tsx: LocaleToggle gains variant passthrough.
site-header.tsx: <LocaleToggle variant="navbar"> added to the main nav
(homepage + /sightings /witnesses /objects /locations /operations
/documents).
bureau-nav.tsx: optional `locale` prop renders the same toggle pushed
to the right (ml-auto) on /bureau, /c/[slug], /h/[id], /jobs/[id].
All four callers now pass locale (getLocale added to h + jobs pages).
Cookie-based: switching sets `locale` cookie + router.refresh(); the
server re-renders every component through getLocale(), so the entire
page — headers, hero, summaries, case narratives, entity cards — flips
language in one click. The floating bottom-left toggle stays as a global
fallback for pages without a navbar (/d, /e, /search, /graph).
Also this session: Sun-Tzu smoke succeeded on the refreshed
CLAUDE_CODE_OAUTH_TOKEN — brief B-0001 written for the green fireballs
("bolas de fogo verdes confinadas ao corredor nuclear... cor espectral
e trajetória quase horizontal que os próprios analistas consideraram
irreconciliáveis com meteoros naturais", 3 pillars). Bulk entity
enrichment resumed in the background.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
38 lines
1.6 KiB
TypeScript
38 lines
1.6 KiB
TypeScript
/**
|
|
* /bureau — Case file library.
|
|
*
|
|
* Reader-facing list of every assembled narrative. No detective surfacing,
|
|
* no artefact dumps. Just stories with hooks.
|
|
*/
|
|
import { AuthBar } from "@/components/auth-bar";
|
|
import { BureauNav } from "@/components/bureau-nav";
|
|
import { CaseLibrary } from "@/components/case-library";
|
|
import { getLocale } from "@/components/locale-toggle";
|
|
|
|
export const runtime = "nodejs";
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export default async function BureauPage() {
|
|
const locale = (await getLocale()) === "en" ? "en" : "pt-br";
|
|
|
|
return (
|
|
<div className="min-h-screen bg-[#0a0e1a] text-[#e7ecf3]">
|
|
<BureauNav locale={locale} crumbs={[{ label: locale === "en" ? "case files" : "casos" }]} />
|
|
<AuthBar />
|
|
<div className="mx-auto max-w-5xl px-4 py-6 pt-4">
|
|
<header className="mb-6 border-b border-[rgba(224,192,128,0.32)] pb-4">
|
|
<h1 className="font-mono text-3xl text-[#e0c080]">
|
|
{locale === "en" ? "▍ The Case Files" : "▍ Os Arquivos do Caso"}
|
|
</h1>
|
|
<p className="text-[#8896aa] text-sm mt-1">
|
|
{locale === "en"
|
|
? "Narratives assembled from the declassified record. Each case is a story — written from primary documents, with citations linked to source pages."
|
|
: "Narrativas montadas a partir do registro desclassificado. Cada caso é uma história — escrita a partir de documentos primários, com citações vinculadas às páginas-fonte."}
|
|
</p>
|
|
</header>
|
|
|
|
<CaseLibrary locale={locale} layout="grid" />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|