import { STYLE_8D_PIPELINE_STEPS } from '../lib/styleProfile' import { jobStatusLabel } from '../lib/jobStatus' import type { JobData } from '../types/api' import { ProgressBar, StatusBadge } from './ui' import { jobStatusBadgeClass } from '../lib/jobStatus' const STEP_STATUS_LABEL: Record = { pending: '等待', running: '進行中', succeeded: '完成', failed: '失敗', skipped: '略過', cancelled: '取消', } export function Style8DJobPanel({ job }: { job: JobData }) { const steps = job.progress?.steps ?? [] const stepMap = new Map(steps.map((s) => [s.id, s])) const pct = job.progress?.percentage ?? 0 return (

{job.progress?.summary || '等待 Worker 接手…'}

{jobStatusLabel(job.status)} {pct}%
    {STYLE_8D_PIPELINE_STEPS.map((step) => { const live = stepMap.get(step.id) const status = live?.status ?? 'pending' const isDone = status === 'succeeded' || status === 'done' const isRunning = status === 'running' return (
  1. {step.title} · {STEP_STATUS_LABEL[status] ?? status}
  2. ) })}
) }