From 7305a614ca20d50e6ab50bbcfbb128a6f1f90e53 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Sun, 15 Jun 2025 04:41:55 +0000
Subject: (최겸) 기술영업 벤더 개발
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/tech-vendors/items-table/item-table.tsx | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

(limited to 'lib/tech-vendors/items-table/item-table.tsx')

diff --git a/lib/tech-vendors/items-table/item-table.tsx b/lib/tech-vendors/items-table/item-table.tsx
index 52e5a57f..2eecd829 100644
--- a/lib/tech-vendors/items-table/item-table.tsx
+++ b/lib/tech-vendors/items-table/item-table.tsx
@@ -11,17 +11,20 @@ import { useDataTable } from "@/hooks/use-data-table"
 import { DataTable } from "@/components/data-table/data-table"
 import { DataTableAdvancedToolbar } from "@/components/data-table/data-table-advanced-toolbar"
 import { getColumns } from "./item-table-columns"
-import { TechVendorItemsView } from "@/db/schema/techVendors"
+import { getVendorItemsByType } from "@/lib/tech-vendors/service"
 import { TechVendorItemsTableToolbarActions } from "./item-table-toolbar-actions"
 
 interface TechVendorItemsTableProps {
-  data: (TechVendorItemsView & { techVendorType?: string })[]
+  promises: Promise<Awaited<ReturnType<typeof getVendorItemsByType>>>
   vendorId: number
   vendorType: string
 }
 
-export function TechVendorItemsTable({ data, vendorId, vendorType }: TechVendorItemsTableProps) {
-  const [rowAction, setRowAction] = React.useState<DataTableRowAction<TechVendorItemsView> | null>(null)
+export function TechVendorItemsTable({ promises, vendorId, vendorType }: TechVendorItemsTableProps) {
+  // Suspense로 받아온 데이터
+  const { data } = React.use(promises)
+
+  const [rowAction, setRowAction] = React.useState<DataTableRowAction<any> | null>(null)
 
   const columns = React.useMemo(
     () => getColumns({ 
@@ -31,11 +34,13 @@ export function TechVendorItemsTable({ data, vendorId, vendorType }: TechVendorI
     [vendorType]
   )
 
-  const filterFields: DataTableFilterField<TechVendorItemsView>[] = []
+  const filterFields: DataTableFilterField<any>[] = []
 
-  const advancedFilterFields: DataTableAdvancedFilterField<TechVendorItemsView>[] = [
-    { id: "itemName", label: "Item Name", type: "text" },
+  const advancedFilterFields: DataTableAdvancedFilterField<any>[] = [
+    { id: "itemList", label: "Item List", type: "text" },
     { id: "itemCode", label: "Item Code", type: "text" },
+    { id: "workType", label: "Work Type", type: "text" },
+    { id: "subItemList", label: "Sub Item List", type: "text" },
     { id: "createdAt", label: "Created at", type: "date" },
     { id: "updatedAt", label: "Updated at", type: "date" },
   ]
-- 
cgit v1.2.3

