import Link from "next/link"; import { formatDistanceToNowStrict } from "date-fns"; import { cn } from "@/lib/utils"; import type { QcQueueEntry } from "@/lib/dashboard/ops"; /** * What is waiting on someone to watch the frames, oldest first. * * Everything upstream of QC is worked by the farm; this is the one stage that * only drains when a person sits down to it, which is why depth here is worth * a panel of its own rather than a filter on the queue page. */ export function QcQueue({ entries, staleHours }: { entries: QcQueueEntry[]; staleHours: number }) { const oldest = entries[0]; return (

{entries.length === 0 ? "QC queue empty" : `${entries.length} waiting on QC`} {oldest && ( oldest {formatDistanceToNowStrict(oldest.since)} )}

Open QC โ†’
{entries.length === 0 ? (

Nothing is waiting on a QC pass.

) : (
{entries.map((e) => { const stale = Date.now() - e.since.getTime() > staleHours * 3600_000; return ( ); })}
Shot Version Waiting Frames Submitted by
{e.shotCode}
{e.projectCode} {e.episode ? ` ยท ep ${e.episode}` : ""}
{e.versionString} {formatDistanceToNowStrict(e.since)} {e.frameStart}โ€“{e.frameEnd} {e.submittedBy ?? "โ€”"}
)}
); }