import { AI_DOC_URL } from "yt-dlp-transcript-common/lib/project"; export type NavLink = { href: string; label: string; external?: boolean }; // The header's inline nav (and the mobile sheet's first links), from what this // build has. Ask AI is new: the chat was only reachable from the workspace // control or from Use with AI, which is not where anyone looks for it. Use // with AI is the homepage's AI and MCP doc (release 16 slice DX): off this // site, so a plain in the same tab, not a client navigation. Reports // shows when this build has a report (public/reports/index.json). // // A CITED site (site.json `search: false`) publishes only its reports and // their moments: no search, no chat, no downloads or duplicates, and nothing // for an AI to read — its nav is Reports alone, or nothing when its one // report IS the home page (`singleReport`). export function headerNavLinks(has: { cited: boolean; reports: boolean; duplicates: boolean; downloads: boolean; singleReport?: boolean; }): NavLink[] { if (has.cited) return has.singleReport ? [] : [{ href: "/reports/", label: "Reports" }]; return [ { href: "/", label: "Search" }, { href: "/ask/", label: "Ask AI" }, ...(has.reports ? [{ href: "/reports/", label: "Reports" }] : []), ...(has.duplicates ? [{ href: "/duplicates", label: "Duplicates" }] : []), ...(has.downloads ? [{ href: "/downloads", label: "Downloads" }] : []), { href: AI_DOC_URL, label: "Use with AI", external: true }, ]; }