From 4ee8b24cfadf47452807fa2af801385ed60ab47c Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 15 Sep 2025 14:41:01 +0000
Subject: (대표님) 작업사항 - rfqLast, tbeLast, pdfTron, userAuth
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/rfq-last/table/rfq-table-columns.tsx | 73 ++++++++++++++++----------------
 1 file changed, 37 insertions(+), 36 deletions(-)

(limited to 'lib/rfq-last/table/rfq-table-columns.tsx')

diff --git a/lib/rfq-last/table/rfq-table-columns.tsx b/lib/rfq-last/table/rfq-table-columns.tsx
index 5f5efcb4..eaf00660 100644
--- a/lib/rfq-last/table/rfq-table-columns.tsx
+++ b/lib/rfq-last/table/rfq-table-columns.tsx
@@ -18,6 +18,7 @@ import { DataTableRowAction } from "@/types/table";
 import { format, differenceInDays } from "date-fns";
 import { ko } from "date-fns/locale";
 import { useRouter } from "next/navigation";
+import { RfqSealToggleCell } from "./rfq-seal-toggle-cell";
 
 type NextRouter = ReturnType<typeof useRouter>;
 
@@ -120,18 +121,18 @@ export function getRfqColumns({
       {
         accessorKey: "rfqSealedYn",
         header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="견적 밀봉" />,
-        cell: ({ row }) => {
-          const isSealed = row.original.rfqSealedYn;
-          return (
-            <div className="flex justify-center">
-              {isSealed ? (
-                <Lock className="h-4 w-4 text-red-500" />
-              ) : (
-                <LockOpen className="h-4 w-4 text-gray-400" />
-              )}
-            </div>
-          );
-        },
+        cell: ({ row, table }) => (
+          <RfqSealToggleCell
+            rfqId={row.original.id}
+            isSealed={row.original.rfqSealedYn}
+            onUpdate={() => {
+              // 테이블 데이터를 새로고침하는 로직
+              // 이 부분은 상위 컴포넌트에서 refreshData 함수를 prop으로 전달받아 사용
+              const meta = table.options.meta as any;
+              meta?.refreshData?.();
+            }}
+          />
+        ),
         size: 80,
       },
 
@@ -453,18 +454,18 @@ export function getRfqColumns({
       {
         accessorKey: "rfqSealedYn",
         header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="견적 밀봉" />,
-        cell: ({ row }) => {
-          const isSealed = row.original.rfqSealedYn;
-          return (
-            <div className="flex justify-center">
-              {isSealed ? (
-                <Lock className="h-4 w-4 text-red-500" />
-              ) : (
-                <LockOpen className="h-4 w-4 text-gray-400" />
-              )}
-            </div>
-          );
-        },
+        cell: ({ row, table }) => (
+          <RfqSealToggleCell
+            rfqId={row.original.id}
+            isSealed={row.original.rfqSealedYn}
+            onUpdate={() => {
+              // 테이블 데이터를 새로고침하는 로직
+              // 이 부분은 상위 컴포넌트에서 refreshData 함수를 prop으로 전달받아 사용
+              const meta = table.options.meta as any;
+              meta?.refreshData?.();
+            }}
+          />
+        ),
         size: 80,
       },
 
@@ -815,18 +816,18 @@ export function getRfqColumns({
       {
         accessorKey: "rfqSealedYn",
         header: ({ column }) => <DataTableColumnHeaderSimple column={column} title="견적 밀봉" />,
-        cell: ({ row }) => {
-          const isSealed = row.original.rfqSealedYn;
-          return (
-            <div className="flex justify-center">
-              {isSealed ? (
-                <Lock className="h-4 w-4 text-red-500" />
-              ) : (
-                <LockOpen className="h-4 w-4 text-gray-400" />
-              )}
-            </div>
-          );
-        },
+        cell: ({ row, table }) => (
+          <RfqSealToggleCell
+            rfqId={row.original.id}
+            isSealed={row.original.rfqSealedYn}
+            onUpdate={() => {
+              // 테이블 데이터를 새로고침하는 로직
+              // 이 부분은 상위 컴포넌트에서 refreshData 함수를 prop으로 전달받아 사용
+              const meta = table.options.meta as any;
+              meta?.refreshData?.();
+            }}
+          />
+        ),
         size: 80,
       },
 
-- 
cgit v1.2.3

