"use client"; // The hub's front: what it is, the official instances it searches, the // archives a visitor added, and the form to add another — in the homepage's // register (homepage/app/page.tsx): short declarative sentences, no eyebrow // over a band, no subtitle under a heading (nor under a card's title: the // site's description is not shown), Title Case headings, and each heading // after the H1 names what is under it. // // Two kinds of number, deliberately kept apart. An official card shows the // homepage's own figures for that archive, composed at hub build time // (/hub-summary.json, useHubSummary) — the same numbers the homepage prints, // omitted one by one when the file lacks them. An added archive has no such // file behind it, so its card shows only the live channel count its // descriptor gave. The live federation total is HubStats, under the shelf. // // The official cards come in the homepage's order (the summary's `sites`, the // order its ArchiveCards and growth chart draw in), and each wears the colour // its homepage card wears (lib/siteColor.ts): its archive's OWN accent when the // site sets one (the tool has no colour, the archives do) — a named accent at // its value on the base in force — and its homepage chart colour when it sets // none (siteChartColors: the palette slot at its index in the summary, or the // lowest free one when an accent's family holds that). Order and colour are // useHubSites' (officialInstances), shared with the scope chips, the results' // stripes and /ask, so an archive is one colour on every surface. With no // summary the order is hub-sites.json's and the colour the card's place. An // added archive wears its own published hex fitted to the base in force // (useHubSites, release 11 O2b), or, with none, the family's signal colour. import { X } from "lucide-react"; import { Badge } from "yt-dlp-transcript-common/components/ui/badge"; import type { RegisteredSite } from "yt-dlp-transcript-common/components/siteRegistry"; import type { HubSummarySite } from "yt-dlp-transcript-common/lib/hubSummary"; import AddArchive from "./AddArchive"; import { useHubSites } from "./useHubSites"; // Fall back to the family's signal colour when a site declares no accent. const FALLBACK_ACCENT = "var(--brand)"; function Figure({ value, unit }: { value: number | undefined; unit: string }) { if (value === undefined) return null; return (
{unit}
{value.toLocaleString()}
); } function ArchiveCard({ site, figures, index, accent, onRemove, }: { site: RegisteredSite; // The stripe's colour, from useHubSites: an official card's, or an added // one's own hex fitted per base, or the family's signal colour. accent: string; // Official: the build-time figures (null when the summary lacks them). // Added: undefined — the card shows the descriptor's channel count only. figures?: HubSummarySite | null; index: number; onRemove?: (origin: string) => void; }) { const href = site.siteUrl || site.origin; const channels = figures === undefined ? site.channelCount : figures?.channels; const anyFigure = channels !== undefined || figures?.recordings !== undefined || figures?.transcripts !== undefined || figures?.hoursArchived !== undefined; return (
  • ); } const GRID = "grid list-none grid-cols-1 border-t border-l border-border sm:grid-cols-2 lg:grid-cols-3"; export default function ArchiveShelf() { const { official, added, summary, removeSite } = useHubSites(); const hours = summary?.official?.hoursArchived; return (

    {hours ? ( <> {hours.toLocaleString()} {" "} hours of speech from every official archive, searchable at once. ) : ( <> {official.length > 0 ? "Every official archive, searchable at once." : "Every archive you add, searchable at once."} )}

    One search runs across all of them, in your browser. You can add any other Archilyzer archive to your own search, below. It stays in this browser until you remove it.

    {official.length > 0 ? (

    Official Instances

    ) : (

    This hub has no official instances. Add an archive to search it.

    )}
    {added.length > 0 && ( <>

    Archives You Added

    )}
    ); }