"use client"; import { useRouter } from "next/navigation"; import { StreamActionLog } from "yt-dlp-transcript-common/components/StreamActionLog"; import { articlesExportAction, articlesPrepareAction } from "../lib/articlesActions"; import { cancelJobAction } from "../../jobs/actions"; // The Articles tab's two jobs, on the reports queue: "Prepare evidence media" // (every published article's clips and captures, then their exports) and // "Export articles". Each streams its log; when it settles the tab re-renders // with what the job wrote. export function PrepareArticlesMediaButton() { const router = useRouter(); return ( articlesPrepareAction()} cancelAction={cancelJobAction} buttonLabel="Prepare evidence media" runningLabel="Preparing evidence media…" onSettled={(started) => { if (started) router.refresh(); }} /> ); } export function ExportArticlesButton() { const router = useRouter(); return ( articlesExportAction()} cancelAction={cancelJobAction} buttonLabel="Export articles" runningLabel="Exporting articles…" onSettled={(started) => { if (started) router.refresh(); }} /> ); }