import type { HomepageOfficialTotals } from "yt-dlp-transcript-common/lib/homepageSummary"; // The family's numbers as one readout strip: hairline cells, a figure and a // plain label each. Everything is the sum over the official instances (the // summary's `official`), which is what the caption claims. // // The "gone" cell is the one that carries the project's argument, so it is the // one that gets the width: a full row on a phone, two cells on a wide screen. export function FamilyStats({ official, generatedAt, }: { official: HomepageOfficialTotals; generatedAt: string | null; }) { const cells = [ { value: official.hoursArchived, label: "Hours of speech" }, { value: official.transcripts, label: "Transcripts" }, { value: official.recordings, label: "Recordings" }, { value: official.channels, label: "Channels" }, { value: official.sites, label: "Official instances" }, ]; const built = generatedAt ? new Date(generatedAt) : null; const builtOk = built && !Number.isNaN(built.getTime()); return (
{/* Seven lg columns when the gone cell (span 2) is drawn, five when it is not — otherwise the row ends in two empty columns. Both class strings are complete literals (Tailwind v4 scans source). */}
0 ? "lg:grid-cols-7" : "lg:grid-cols-5" } border-t border-l border-[var(--border)]`} > {cells.map((c, i) => (
{c.label}
{c.value.toLocaleString()}
))} {official.gone > 0 && (
Recordings gone at the source, still here
{official.gone.toLocaleString()}
)}
{builtOk && (

Across the official instances · index built{" "}

)}
); }