import type { Metadata } from "next"; import { REPORT_PLACEHOLDER_ID, reportFullTitle } from "yt-dlp-transcript-common/lib/report/views"; import ReportHistory from "yt-dlp-transcript-common/components/report/ReportHistory"; import { EmptyState } from "yt-dlp-transcript-common/components/report/parts"; import { PageShell } from "../../../components/PageShell"; import { ARTICLES_ROUTE_BASE, articleIds, readArticleHistory } from "../../../lib/articles"; // /articles//history/: the article's revisions, from // /articles//history/history.json; one with none published says so. export const dynamicParams = false; export function generateStaticParams(): { reportId: string }[] { const ids = articleIds(); return (ids.length > 0 ? ids : [REPORT_PLACEHOLDER_ID]).map((reportId) => ({ reportId })); } type Params = { params: Promise<{ reportId: string }> }; export async function generateMetadata({ params }: Params): Promise { const view = readArticleHistory((await params).reportId); if (!view) return { title: "No history" }; return { title: `Revision history — ${reportFullTitle(view)}` }; } export default async function ArticleHistoryPage({ params }: Params) { const view = readArticleHistory((await params).reportId); return ( {view ? ( ) : ( This article has no published revision history. )} ); }