/**
 * /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 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>
  );
}
