diff --git a/components/jobs/job-detail-pane.tsx b/components/jobs/job-detail-pane.tsx new file mode 100644 index 0000000..5f7b2cd --- /dev/null +++ b/components/jobs/job-detail-pane.tsx @@ -0,0 +1,76 @@ +'use client' + +import { cn } from '@/lib/utils' +import { JOB_STATUS_LABELS, JOB_STATUS_COLORS } from '@/components/shared/job-status' +import { jobStatusToApi } from '@/lib/job-status' +import type { JobWithRelations } from '@/actions/jobs-page' + +interface FieldRowProps { + label: string + children: React.ReactNode +} + +function FieldRow({ label, children }: FieldRowProps) { + return ( +
+ {label} + {children} +
+ ) +} + +interface JobDetailPaneProps { + job: JobWithRelations | null +} + +export default function JobDetailPane({ job }: JobDetailPaneProps) { + if (!job) { + return ( +
+ Selecteer een job om details te zien +
+ ) + } + + const apiStatus = jobStatusToApi(job.status) + + return ( +
+ + + {JOB_STATUS_LABELS[apiStatus]} + + + {job.kind} + {job.productName} + {job.modelId || '—'} + {job.inputTokens?.toLocaleString() || '—'} + {job.outputTokens?.toLocaleString() || '—'} + {job.cacheReadTokens?.toLocaleString() || '—'} + {job.cacheWriteTokens?.toLocaleString() || '—'} + + {job.branch || '—'} + + + {job.prUrl ? ( + + PR openen ↗ + + ) : '—'} + + + {job.error ? ( +
+            {job.error}
+          
+ ) : '—'} +
+ + {job.startedAt ? new Date(job.startedAt).toLocaleString('nl-NL') : '—'} + + + {job.finishedAt ? new Date(job.finishedAt).toLocaleString('nl-NL') : '—'} + +
+ ) +}