Replace hardcoded data-debug-id + data-debug-label attribute pairs with
{...debugProps(id, component, file)} spread in all 17 components/shared/
files. Existing debug-ids preserved unchanged.
46 lines
1.5 KiB
TypeScript
46 lines
1.5 KiB
TypeScript
'use client'
|
|
|
|
import { Select, SelectContent, SelectItem, SelectTrigger } from '@/components/ui/select'
|
|
import { cn } from '@/lib/utils'
|
|
import type { PbiStatusApi } from '@/lib/task-status'
|
|
import { debugProps } from '@/lib/debug'
|
|
|
|
export const PBI_STATUS_LABELS: Record<PbiStatusApi, string> = {
|
|
ready: 'Klaar voor sprint',
|
|
blocked: 'Geblokkeerd',
|
|
failed: 'Gefaald',
|
|
done: 'Afgerond',
|
|
}
|
|
|
|
export const PBI_STATUS_COLORS: Record<PbiStatusApi, string> = {
|
|
ready: 'bg-status-todo/15 text-status-todo border-status-todo/30',
|
|
blocked: 'bg-status-blocked/15 text-status-blocked border-status-blocked/30',
|
|
failed: 'bg-status-failed/15 text-status-failed border-status-failed/30',
|
|
done: 'bg-status-done/15 text-status-done border-status-done/30',
|
|
}
|
|
|
|
interface PbiStatusSelectProps {
|
|
value: PbiStatusApi
|
|
onChange: (value: PbiStatusApi) => void
|
|
className?: string
|
|
}
|
|
|
|
export function PbiStatusSelect({ value, onChange, className }: PbiStatusSelectProps) {
|
|
return (
|
|
<span {...debugProps('pbi-status-select', 'PbiStatusSelect', 'shared/pbi-status-select.tsx')}>
|
|
<Select
|
|
value={value}
|
|
onValueChange={(v) => { if (v) onChange(v as PbiStatusApi) }}
|
|
>
|
|
<SelectTrigger className={cn('w-full', className)}>
|
|
{PBI_STATUS_LABELS[value] ?? value}
|
|
</SelectTrigger>
|
|
<SelectContent>
|
|
<SelectItem value="ready">Klaar voor sprint</SelectItem>
|
|
<SelectItem value="blocked">Geblokkeerd</SelectItem>
|
|
<SelectItem value="done">Afgerond</SelectItem>
|
|
</SelectContent>
|
|
</Select>
|
|
</span>
|
|
)
|
|
}
|