import type { DirectiveSummary, DirectiveStatus } from "../../lib/api"; const STATUS_BADGE: Record = { draft: { color: "text-[#7788aa] border-[#2a3a5a]", label: "DRAFT" }, active: { color: "text-green-400 border-green-800", label: "ACTIVE" }, idle: { color: "text-yellow-400 border-yellow-800", label: "IDLE" }, paused: { color: "text-orange-400 border-orange-800", label: "PAUSED" }, archived: { color: "text-[#556677] border-[#2a3a5a]", label: "ARCHIVED" }, }; interface DirectiveListProps { directives: DirectiveSummary[]; selectedId: string | null; onSelect: (id: string) => void; onCreate: () => void; } export function DirectiveList({ directives, selectedId, onSelect, onCreate }: DirectiveListProps) { return (
Directives
{directives.length === 0 ? (
No directives yet
) : ( directives.map((d) => { const badge = STATUS_BADGE[d.status] || STATUS_BADGE.draft; const progress = d.totalSteps > 0 ? Math.round((d.completedSteps / d.totalSteps) * 100) : 0; return ( ); }) )}
); }