"use client"; import { useRouter } from "next/navigation"; import { StreamActionLog } from "yt-dlp-transcript-common/components/StreamActionLog"; import { reportsPrepareAction } from "../lib/reportsPrepareAction"; import { cancelJobAction } from "../../jobs/actions"; // "Prepare evidence media": queues the site's reports-prepare job and streams // its log. When the job settles the tab is re-rendered, so the media summary // beside it shows the manifest the job just wrote. export function PrepareReportMediaButton({ siteId }: { siteId: string }) { const router = useRouter(); return ( reportsPrepareAction(siteId)} cancelAction={cancelJobAction} buttonLabel="Prepare evidence media" runningLabel="Preparing evidence media…" onSettled={(started) => { if (started) router.refresh(); }} /> ); }