/**
* CaseLibrary — homepage case-file strip.
*
* The /bureau page uses a richer browser with filters; the home only needs
* a quick magazine-style preview (one hero + a few cards) above the fold.
* Both pull from the shared lib/cases.ts loader.
*/
import Link from "next/link";
import { loadCases, type CaseFile } from "@/lib/cases";
export async function CaseLibrary({
locale,
limit,
layout = "hero+grid",
}: {
locale: "pt-br" | "en";
limit?: number;
/** "hero+grid" = first case big + rest small (homepage); "grid" = all equal */
layout?: "hero+grid" | "grid";
}) {
const allCases = await loadCases(locale);
const cases = typeof limit === "number" ? allCases.slice(0, limit) : allCases;
if (cases.length === 0) {
return (
{locale === "pt-br"
? "Nenhum caso narrado ainda. As primeiras histórias chegam em breve."
: "No case files yet. The first stories arrive soon."}
{c.opening}
)}{c.opening}
)}