diff --git a/lib/idea-status-colors.ts b/lib/idea-status-colors.ts new file mode 100644 index 0000000..6e947b6 --- /dev/null +++ b/lib/idea-status-colors.ts @@ -0,0 +1,56 @@ +// Mapping van IdeaStatus → Tailwind/MD3-classes voor badge-rendering. +// Hergebruikt de bestaande --status-*-tokens (zie app/styles/theme.css). +// CLAUDE.md hardstop: nooit `bg-blue-500` o.i.d.; altijd MD3-tokens. + +import type { IdeaStatus } from '@prisma/client' + +export interface IdeaStatusBadge { + label: string + classes: string + pulse?: boolean +} + +const PILL = 'inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium' + +// Per-status: label + Tailwind-classes + optionele pulse-indicator. +// in-progress + status-blocked + status-review + status-done worden hergebruikt. +const TABLE: Record = { + DRAFT: { + label: 'Concept', + classes: `${PILL} bg-surface-variant text-on-surface-variant border-outline-variant`, + }, + GRILLING: { + label: 'Grillen…', + classes: `${PILL} bg-status-in-progress/15 text-status-in-progress border-status-in-progress/30`, + pulse: true, + }, + GRILL_FAILED: { + label: 'Grill mislukt', + classes: `${PILL} bg-status-blocked/15 text-status-blocked border-status-blocked/30`, + }, + GRILLED: { + label: 'Gegrilld', + classes: `${PILL} bg-status-review/15 text-status-review border-status-review/30`, + }, + PLANNING: { + label: 'Plannen…', + classes: `${PILL} bg-status-in-progress/15 text-status-in-progress border-status-in-progress/30`, + pulse: true, + }, + PLAN_FAILED: { + label: 'Plan mislukt', + classes: `${PILL} bg-status-blocked/15 text-status-blocked border-status-blocked/30`, + }, + PLAN_READY: { + label: 'Plan klaar', + classes: `${PILL} bg-status-review/15 text-status-review border-status-review/30`, + }, + PLANNED: { + label: 'Gepland', + classes: `${PILL} bg-status-done/15 text-status-done border-status-done/30`, + }, +} + +export function getIdeaStatusBadge(status: IdeaStatus): IdeaStatusBadge { + return TABLE[status] +}