import type { Metadata } from "next"; import ReportIndex from "../components/reports/ReportIndex"; import Link from "next/link"; import { isCitedSite } from "yt-dlp-transcript-common/lib/siteSchema"; import { textLink } from "../components/reports/parts"; import { readReportIndex, reportIds } from "../lib/reports"; import { currentSite } from "../lib/site"; import { instanceMode } from "../lib/mode"; export const metadata: Metadata = { title: "Reports" }; // The report index, from /reports/index.json (common/lib/report/views.ts). A // cited site with more than one report renders the same index as its home // page. A cited site with ONE report has no index: its home page is the // report, so this route only forwards there (a static export has no server // redirect; React hoists the refresh into the head). export default function ReportsPage() { const site = currentSite(); if (instanceMode() === "site" && isCitedSite(site) && reportIds().length === 1) { return ( <>

{site.siteTitle}

); } return ; }