export function JobStatusPanel({ job }) {
const percent = Math.round(job?.progress?.percent || 0);
return (
Job Status
{job?.status || 'idle'}
{job?.error ? : null}
{job?.progress?.detail || job?.currentStep || 'No active job'}
{job ? `${percent}%` : '-'}
{(job?.logs || ['No logs yet.']).join('\n')}
);
}
function Info({ label, value, tone = 'text-zinc-300' }) {
return (
{label}
{value}
);
}
function statusClass(status) {
if (status === 'success') return 'border-emerald-800 bg-emerald-950 text-emerald-300';
if (status === 'failed') return 'border-red-800 bg-red-950 text-red-300';
if (status === 'running' || status === 'queued') return 'border-cyan-800 bg-cyan-950 text-cyan-300';
return 'border-zinc-800 bg-zinc-950 text-zinc-400';
}
function formatTime(value) {
if (!value) return '-';
return new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'medium' }).format(new Date(value));
}