From 1b692b8cde4a888c8a35af69231f181b57bf5619 Mon Sep 17 00:00:00 2001 From: soryu Date: Fri, 6 Feb 2026 20:06:30 +0000 Subject: Fix: Cleanup old chain code --- .../src/components/directives/DirectiveDetail.tsx | 160 +++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 makima/frontend/src/components/directives/DirectiveDetail.tsx (limited to 'makima/frontend/src/components/directives/DirectiveDetail.tsx') diff --git a/makima/frontend/src/components/directives/DirectiveDetail.tsx b/makima/frontend/src/components/directives/DirectiveDetail.tsx new file mode 100644 index 0000000..06b24bb --- /dev/null +++ b/makima/frontend/src/components/directives/DirectiveDetail.tsx @@ -0,0 +1,160 @@ +import { useState } from "react"; +import type { DirectiveWithProgress, DirectiveGraphResponse } from "../../lib/api"; +import { OverviewTab } from "./OverviewTab"; +import { ChainTab } from "./ChainTab"; +import { EventsTab } from "./EventsTab"; +import { EvaluationsTab } from "./EvaluationsTab"; +import { ApprovalsTab } from "./ApprovalsTab"; +import { VerifiersTab } from "./VerifiersTab"; + +interface DirectiveDetailProps { + directive: DirectiveWithProgress; + graph: DirectiveGraphResponse | null; + loading: boolean; + onBack: () => void; + onRefresh: () => void; + onStart: () => void; + onPause: () => void; + onResume: () => void; + onStop: () => void; +} + +export function DirectiveDetail({ + directive, + graph, + loading, + onBack, + onRefresh, + onStart, + onPause, + onResume, + onStop, +}: DirectiveDetailProps) { + const [activeTab, setActiveTab] = useState<"overview" | "chain" | "events" | "evaluations" | "approvals" | "verifiers">("overview"); + + if (loading) { + return ( +
+

Loading...

+
+ ); + } + + const statusColor = { + draft: "text-[#556677] bg-[#556677]/10 border-[#556677]/30", + planning: "text-yellow-400 bg-yellow-400/10 border-yellow-400/30", + active: "text-green-400 bg-green-400/10 border-green-400/30", + paused: "text-yellow-400 bg-yellow-400/10 border-yellow-400/30", + completed: "text-[#75aafc] bg-[#75aafc]/10 border-[#75aafc]/30", + archived: "text-[#556677] bg-[#556677]/10 border-[#556677]/30", + failed: "text-red-400 bg-red-400/10 border-red-400/30", + }[directive.status] || "text-[#556677] bg-[#556677]/10 border-[#556677]/30"; + + return ( +
+ {/* Header */} +
+
+
+ +

+ {directive.title || directive.goal.slice(0, 50)} +

+ + {directive.status} + +
+
+ {directive.status === "draft" && ( + + )} + {directive.status === "active" && ( + + )} + {directive.status === "paused" && ( + + )} + {["active", "paused"].includes(directive.status) && ( + + )} + +
+
+
+ + {/* Tabs */} +
+ {(["overview", "chain", "events", "evaluations", "approvals", "verifiers"] as const).map((tab) => ( + + ))} +
+ + {/* Tab Content */} +
+ {activeTab === "overview" && ( + + )} + {activeTab === "chain" && ( + + )} + {activeTab === "events" && ( + + )} + {activeTab === "evaluations" && ( + + )} + {activeTab === "approvals" && ( + + )} + {activeTab === "verifiers" && ( + + )} +
+
+ ); +} -- cgit v1.2.3