From e84cf02a1cb4959a9d3bb5bbf37885c13a447f78 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Mon, 13 Oct 2025 17:29:33 +0900
Subject: (김준회) SHI/벤더 PO 구현
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/contract/contract-items-card.tsx | 76 +++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 components/contract/contract-items-card.tsx

(limited to 'components/contract/contract-items-card.tsx')

diff --git a/components/contract/contract-items-card.tsx b/components/contract/contract-items-card.tsx
new file mode 100644
index 00000000..0d43f979
--- /dev/null
+++ b/components/contract/contract-items-card.tsx
@@ -0,0 +1,76 @@
+import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
+import { formatCurrency } from "@/lib/utils"
+
+interface ContractItem {
+  materialNo?: string
+  itemDescription?: string
+  specification?: string
+  quantity?: number
+  quantityUnit?: string
+  unitPrice?: number | string
+  contractAmount?: number | string
+}
+
+interface ContractItemsCardProps {
+  items: ContractItem[]
+  currency?: string
+}
+
+export function ContractItemsCard({ items, currency = "KRW" }: ContractItemsCardProps) {
+  if (!items || items.length === 0) {
+    return null
+  }
+
+  return (
+    <Card>
+      <CardHeader>
+        <CardTitle className="text-lg">계약 품목</CardTitle>
+      </CardHeader>
+      <CardContent>
+        <div className="overflow-x-auto">
+          <table className="w-full text-sm">
+            <thead className="border-b bg-muted/50">
+              <tr>
+                <th className="px-4 py-3 text-left font-medium">자재번호</th>
+                <th className="px-4 py-3 text-left font-medium">품목/자재내역</th>
+                <th className="px-4 py-3 text-left font-medium">규격</th>
+                <th className="px-4 py-3 text-right font-medium">수량</th>
+                <th className="px-4 py-3 text-right font-medium">단가</th>
+                <th className="px-4 py-3 text-right font-medium">금액</th>
+              </tr>
+            </thead>
+            <tbody>
+              {items.map((item, idx) => (
+                <tr key={idx} className="border-b last:border-0">
+                  <td className="px-4 py-3">{item.materialNo || "-"}</td>
+                  <td className="px-4 py-3">{item.itemDescription || "-"}</td>
+                  <td className="px-4 py-3">{item.specification || "-"}</td>
+                  <td className="px-4 py-3 text-right">
+                    {item.quantity} {item.quantityUnit || ""}
+                  </td>
+                  <td className="px-4 py-3 text-right font-mono">
+                    {item.unitPrice
+                      ? formatCurrency(
+                          parseFloat(item.unitPrice.toString()),
+                          currency
+                        )
+                      : "-"}
+                  </td>
+                  <td className="px-4 py-3 text-right font-mono font-medium">
+                    {item.contractAmount
+                      ? formatCurrency(
+                          parseFloat(item.contractAmount.toString()),
+                          currency
+                        )
+                      : "-"}
+                  </td>
+                </tr>
+              ))}
+            </tbody>
+          </table>
+        </div>
+      </CardContent>
+    </Card>
+  )
+}
+
-- 
cgit v1.2.3

