"use client"; import Link from "next/link"; import { useQuery } from "@tanstack/react-query"; import { Layers, ExternalLink } from "lucide-react"; import { cn } from "@/lib/utils"; import { EXPORT_STATUS_STYLES, statusLabel, } from "@/app/(dashboard)/pipeline/status-colors"; interface ExportRow { id: string; versionString: string; status: string; statusChangedAt: string; createdAt: string; outputDir: string; job: { attempt: number; progress: number; machineName: string | null; errorMessage: string | null; } | null; } /** * "Exports" tab on the shot detail page (RenderPipeline2 §13) — the render * pipeline history for this shot, linking into the Export detail page. */ export function ShotExportsTab({ shotId }: { shotId: string }) { const { data, isLoading } = useQuery({ queryKey: ["shot-exports", shotId], queryFn: async () => { const res = await fetch(`/api/render/queue?shotId=${shotId}&limit=100`); if (!res.ok) throw new Error("Failed to load exports"); return res.json() as Promise<{ exports: ExportRow[] }>; }, refetchInterval: 10000, }); const exports = data?.exports ?? []; if (isLoading) { return
Loading exports…
; } if (exports.length === 0) { return (

No pipeline exports yet — queue one from the After Effects panel.

); } return (
{exports.map((e) => ( {e.versionString} {statusLabel(e.status)} {e.job?.machineName ? `${e.job.machineName} · attempt ${e.job.attempt} · ` : ""} {e.outputDir} {new Date(e.createdAt).toLocaleDateString()} ))}
); }