"use client"; import { useRouter } from "next/navigation"; import { StreamActionLog } from "yt-dlp-transcript-common/components/StreamActionLog"; import { reportsExportAction } from "../lib/reportsExportAction"; import { cancelJobAction } from "../../jobs/actions"; // "Export reports": queues the site's reports-export job (every published // report as HTML, PDF, Markdown and an evidence pack) and streams its log. // When the job settles the tab is re-rendered, so the export list beside it // shows what the job just wrote. export function ExportReportsButton({ siteId }: { siteId: string }) { const router = useRouter(); return ( reportsExportAction(siteId)} cancelAction={cancelJobAction} buttonLabel="Export reports" runningLabel="Exporting reports…" onSettled={(started) => { if (started) router.refresh(); }} /> ); }