From 6fa44c55ff5ba705c5354a3ab0a2ee9d0ac1d85c Mon Sep 17 00:00:00 2001 From: SJCoetz Date: Wed, 29 Jul 2026 20:06:10 +0200 Subject: [PATCH] feat(buyer-tasks): collapsible items-list component Co-authored-by: Orca --- .../buyer-tasks/buyer-task-items-list.tsx | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/components/buyer-tasks/buyer-task-items-list.tsx diff --git a/src/components/buyer-tasks/buyer-task-items-list.tsx b/src/components/buyer-tasks/buyer-task-items-list.tsx new file mode 100644 index 0000000..e7432ff --- /dev/null +++ b/src/components/buyer-tasks/buyer-task-items-list.tsx @@ -0,0 +1,51 @@ +"use client"; + +import { useState } from "react"; +import { ChevronDown, ChevronRight } from "lucide-react"; +import { cn } from "@/lib/utils"; + +export type BuyerTaskItem = { + id: string; + description: string; + quantity: number; + costPrice: number; + sellingPrice: number; +}; + +export function BuyerTaskItemsList({ items }: { items: BuyerTaskItem[] }) { + const [open, setOpen] = useState(false); + + return ( +
+ + {open && ( +
    + {items.map((item) => ( +
  • + {item.description || "(no description)"} + + {item.quantity} × R{item.costPrice.toFixed(2)} + +
  • + ))} +
+ )} +
+ ); +} \ No newline at end of file