From 87044a747b47bd83249d61a45842c7f7b2eae56d Mon Sep 17 00:00:00 2001 From: soryu Date: Sun, 11 Jan 2026 05:52:14 +0000 Subject: Contract system --- .../src/components/contracts/ContractList.tsx | 176 +++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 makima/frontend/src/components/contracts/ContractList.tsx (limited to 'makima/frontend/src/components/contracts/ContractList.tsx') diff --git a/makima/frontend/src/components/contracts/ContractList.tsx b/makima/frontend/src/components/contracts/ContractList.tsx new file mode 100644 index 0000000..3a7b163 --- /dev/null +++ b/makima/frontend/src/components/contracts/ContractList.tsx @@ -0,0 +1,176 @@ +import { useState } from "react"; +import type { ContractSummary, ContractStatus } from "../../lib/api"; +import { PhaseBadge } from "./PhaseBadge"; +import { PhaseProgressBarCompact } from "./PhaseProgressBar"; + +interface ContractListProps { + contracts: ContractSummary[]; + loading: boolean; + onSelect: (id: string) => void; + onCreate: () => void; + selectedId?: string; +} + +const statusColors: Record = { + active: "text-green-400", + completed: "text-blue-400", + archived: "text-[#555]", +}; + +export function ContractList({ + contracts, + loading, + onSelect, + onCreate, + selectedId, +}: ContractListProps) { + const [filter, setFilter] = useState("all"); + + const filteredContracts = + filter === "all" + ? contracts + : contracts.filter((c) => c.status === filter); + + if (loading) { + return ( +
+
Loading...
+
+ ); + } + + return ( +
+ {/* Header */} +
+
+

+ Contracts +

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

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

+
+ ) : ( +
+ {filteredContracts.map((contract) => ( + + ))} +
+ )} +
+
+ ); +} + +export function ContractCard({ + contract, + onClick, +}: { + contract: ContractSummary; + onClick: () => void; +}) { + return ( + + ); +} -- cgit v1.2.3