import type { FC } from 'hono/jsx'; import { Layout } from './layout'; import type { Job, Node, MediaItem } from '../types'; interface ExecutePageProps { jobs: Array<{ job: Job; item: MediaItem | null; node: Node | null; }>; nodes: Node[]; } export const ExecutePage: FC = ({ jobs, nodes }) => { const pending = jobs.filter((j) => j.job.status === 'pending').length; const running = jobs.filter((j) => j.job.status === 'running').length; const done = jobs.filter((j) => j.job.status === 'done').length; const errors = jobs.filter((j) => j.job.status === 'error').length; const hasActiveJobs = running > 0; return ( {/* Stats row */}
{pending} pending {running > 0 && {running} running} {done > 0 && {done} done} {errors > 0 && {errors} error(s)}
{/* Controls */}
{pending > 0 && (
)} {jobs.length === 0 && (

No jobs yet. Go to Review and approve items first.

)}
{/* Job table */} {jobs.length > 0 && ( {jobs.map(({ job, item, node }) => ( ))}
# Item Command Node Status Actions
)} {/* SSE for live updates */} {hasActiveJobs && (