export const TYPE_LABELS: Record<string, string> = {
  name_engraving: "Name Engraving",
  laser_engraving: "Laser Engraving",
  "3d_printing": "3D Printing",
};

export type Stage = {
  value: string;
  label: string;
  next: string | null;
  nextLabel: string | null;
  color: string;
};

export const STAGES: Stage[] = [
  { value: "requested", label: "Requested", next: "design_approval", nextLabel: "Send for design approval", color: "bg-amber-100 text-amber-800" },
  { value: "design_approval", label: "Design Approval", next: "production", nextLabel: "Approve → start production", color: "bg-sky-100 text-sky-800" },
  { value: "production", label: "Production", next: "ready_to_dispatch", nextLabel: "Mark ready to dispatch", color: "bg-violet-100 text-violet-800" },
  { value: "ready_to_dispatch", label: "Ready to Dispatch", next: "dispatched", nextLabel: "Mark dispatched", color: "bg-emerald-100 text-emerald-800" },
  { value: "dispatched", label: "Dispatched", next: null, nextLabel: null, color: "bg-stone-200 text-stone-600" },
  { value: "cancelled", label: "Cancelled", next: null, nextLabel: null, color: "bg-red-100 text-red-800" },
];

export function stageInfo(status: string): Stage {
  return STAGES.find((s) => s.value === status) ?? STAGES[0];
}
