1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
import type { ContractPhase } from "../../lib/api";
interface PhaseBadgeProps {
phase: ContractPhase;
size?: "sm" | "md";
}
const phaseConfig: Record<
ContractPhase,
{ label: string; color: string; bgColor: string }
> = {
research: {
label: "Research",
color: "text-purple-400",
bgColor: "bg-purple-400/10 border-purple-400/30",
},
specify: {
label: "Specify",
color: "text-blue-400",
bgColor: "bg-blue-400/10 border-blue-400/30",
},
plan: {
label: "Plan",
color: "text-cyan-400",
bgColor: "bg-cyan-400/10 border-cyan-400/30",
},
execute: {
label: "Execute",
color: "text-yellow-400",
bgColor: "bg-yellow-400/10 border-yellow-400/30",
},
review: {
label: "Review",
color: "text-green-400",
bgColor: "bg-green-400/10 border-green-400/30",
},
};
export function PhaseBadge({ phase, size = "sm" }: PhaseBadgeProps) {
const config = phaseConfig[phase];
const sizeClasses = size === "sm" ? "px-2 py-0.5 text-[10px]" : "px-3 py-1 text-xs";
return (
<span
className={`${sizeClasses} ${config.color} ${config.bgColor} border font-mono uppercase tracking-wider`}
>
{config.label}
</span>
);
}
export function getPhaseLabel(phase: ContractPhase): string {
return phaseConfig[phase].label;
}
|