import { useState } from "react"; import type { DirectiveSummary, DirectiveStatus } from "../../lib/api"; interface DirectiveListProps { directives: DirectiveSummary[]; loading: boolean; onSelect: (id: string) => void; onCreate: () => void; onDelete?: (directive: DirectiveSummary) => void; selectedId?: string; } const statusColors: Record = { draft: "text-[#888]", planning: "text-yellow-400", active: "text-green-400", paused: "text-orange-400", completed: "text-blue-400", archived: "text-[#555]", failed: "text-red-400", }; export function DirectiveList({ directives, loading, onSelect, onCreate, selectedId, }: DirectiveListProps) { const [filter, setFilter] = useState("all"); const filteredDirectives = filter === "all" ? directives : directives.filter((d) => d.status === filter); if (loading) { return (
Loading...
); } return (
{/* Header */}

Directives

{/* Filter tabs */}
{(["all", "draft", "planning", "active", "paused", "completed", "failed"] as const).map( (status) => ( ) )}
{/* List */}
{filteredDirectives.length === 0 ? (

{filter === "all" ? "No directives yet" : `No ${filter} directives`}

) : (
{filteredDirectives.map((directive) => ( ))}
)}
); }