From 8f725a7c64fbeb85ebeb59b54d2f774e9a0a59d6 Mon Sep 17 00:00:00 2001 From: soryu Date: Fri, 6 Feb 2026 01:02:32 +0000 Subject: Fix: Directive page and remove chain page --- .../frontend/src/components/chains/ChainList.tsx | 191 --------------------- 1 file changed, 191 deletions(-) delete mode 100644 makima/frontend/src/components/chains/ChainList.tsx (limited to 'makima/frontend/src/components/chains/ChainList.tsx') diff --git a/makima/frontend/src/components/chains/ChainList.tsx b/makima/frontend/src/components/chains/ChainList.tsx deleted file mode 100644 index e185efc..0000000 --- a/makima/frontend/src/components/chains/ChainList.tsx +++ /dev/null @@ -1,191 +0,0 @@ -import { useState, useCallback } from "react"; -import type { ChainSummary, ChainStatus } from "../../lib/api"; - -interface ChainListProps { - chains: ChainSummary[]; - loading: boolean; - onSelect: (chainId: string) => void; - onCreate: () => void; - selectedId?: string; - onArchive: (chain: ChainSummary) => void; -} - -const statusColors: Record = { - pending: "text-yellow-400", - active: "text-green-400", - completed: "text-blue-400", - archived: "text-[#555]", -}; - -export function ChainList({ - chains, - loading, - onSelect, - onCreate, - selectedId, - onArchive, -}: ChainListProps) { - const [filter, setFilter] = useState("all"); - const [contextMenuPosition, setContextMenuPosition] = useState<{ x: number; y: number } | null>(null); - const [contextMenuChain, setContextMenuChain] = useState(null); - - const filteredChains = - filter === "all" - ? chains - : chains.filter((c) => c.status === filter); - - const handleContextMenu = useCallback( - (e: React.MouseEvent, chain: ChainSummary) => { - e.preventDefault(); - setContextMenuPosition({ x: e.clientX, y: e.clientY }); - setContextMenuChain(chain); - }, - [] - ); - - const closeContextMenu = useCallback(() => { - setContextMenuPosition(null); - setContextMenuChain(null); - }, []); - - const handleArchive = useCallback(() => { - if (contextMenuChain) { - onArchive(contextMenuChain); - closeContextMenu(); - } - }, [contextMenuChain, onArchive, closeContextMenu]); - - if (loading) { - return ( -
-
Loading...
-
- ); - } - - return ( -
- {/* Header */} -
-
-

- Chains -

- -
- - {/* Filter tabs */} -
- {(["all", "active", "completed", "archived"] as const).map((status) => ( - - ))} -
-
- - {/* Chain list */} -
- {filteredChains.length === 0 ? ( -
-

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

-
- ) : ( -
- {filteredChains.map((chain) => ( - - ))} -
- )} -
- - {/* Context Menu */} - {contextMenuPosition && contextMenuChain && ( -
e.stopPropagation()} - > - - {contextMenuChain.status !== "archived" && ( - - )} -
- )} -
- ); -} -- cgit v1.2.3