"use client"; // THE TWO ANSWERS TO A LIVE RECORDING THAT NEEDS A PERSON (LiveRecordingsAttention): // Record again — record-live with the run's own url and recording keys — and // Acknowledge — seen; the row stays in `pnpm ops get live-recordings` and no // longer counts. A failed press says so. import { useState, useTransition } from "react"; import { acknowledgeLiveRecordingAction, recordLiveAgainAction, reverifyLiveRecordingAction, } from "../channels/[slug]/liveMediaActions"; export function LiveRecordingActions({ slug, id, startedAt, file, canRecordAgain, canVerify = false, }: { slug: string; // A recording's run (id + startedAt), or a set-aside live-recordings.json. id?: string; startedAt?: string; file?: string; canRecordAgain: boolean; // Its landed file's check failed or never ran (REVIEW-7 4): Verify again. canVerify?: boolean; }): React.ReactNode { const what = file ?? `${slug}/${id ?? ""}`; const [pending, startTransition] = useTransition(); const [said, setSaid] = useState<{ error: boolean; text: string } | null>(null); const press = (fn: () => Promise<{ ok: boolean; error?: string } & Record>, done: (r: Record) => string) => startTransition(async () => { try { const r = await fn(); setSaid(r.ok ? { error: false, text: done(r) } : { error: true, text: r.error ?? "failed" }); } catch (e) { setSaid({ error: true, text: (e as Error).message }); } }); const btn = "rounded-md border border-border px-2 py-1 text-xs hover:bg-muted disabled:opacity-50"; return ( {canRecordAgain && id && ( )} {canVerify && id && ( )} {said && ( {said.text} )} ); }