From 688d9884ca98b50d04ac78fc1f6e28e034a519c0 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 3 Sep 2025 12:44:32 +0000
Subject: (대표님) rfq-last 작업, vendorDocu 스키마 변경, 벤더 문서 관련 변경
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../ship/enhanced-doc-table-toolbar-actions.tsx    | 77 +++++++++++++++-------
 1 file changed, 52 insertions(+), 25 deletions(-)

(limited to 'lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx')

diff --git a/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx b/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx
index 4ec57369..94252db5 100644
--- a/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx
+++ b/lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx
@@ -1,4 +1,4 @@
-// enhanced-doc-table-toolbar-actions.tsx - 최적화된 버전
+// enhanced-doc-table-toolbar-actions.tsx - B4 업로드 기능 추가 버전
 "use client"
 
 import * as React from "react"
@@ -11,15 +11,18 @@ import { Button } from "@/components/ui/button"
 import { SimplifiedDocumentsView } from "@/db/schema/vendorDocu"
 import { SendToSHIButton } from "./send-to-shi-button"
 import { ImportFromDOLCEButton } from "./import-from-dolce-button"
+import { BulkB4UploadDialog } from "./bulk-b4-upload-dialog"
 
 interface EnhancedDocTableToolbarActionsProps {
   table: Table<SimplifiedDocumentsView>
   projectType: "ship" | "plant"
+  b4: boolean
 }
 
 export function EnhancedDocTableToolbarActions({
   table,
   projectType,
+  b4
 }: EnhancedDocTableToolbarActionsProps) {
   const [bulkUploadDialogOpen, setBulkUploadDialogOpen] = React.useState(false)
 
@@ -68,31 +71,55 @@ export function EnhancedDocTableToolbarActions({
   }, [table])
 
   return (
-    <div className="flex items-center gap-2">
-      {/* SHIP: DOLCE에서 목록 가져오기 */}
-      <ImportFromDOLCEButton
-        allDocuments={allDocuments}
-        projectIds={projectIds} // 🔥 미리 계산된 projectIds 전달
-        onImportComplete={handleImportComplete}
-      />
+    <>
+      <div className="flex items-center gap-2">
+        {/* SHIP: DOLCE에서 목록 가져오기 */}
+        <ImportFromDOLCEButton
+          allDocuments={allDocuments}
+          projectIds={projectIds} // 🔥 미리 계산된 projectIds 전달
+          onImportComplete={handleImportComplete}
+        />
 
-      {/* Export 버튼 (공통) */}
-      <Button
-        variant="outline"
-        size="sm"
-        onClick={handleExport}
-        className="gap-2"
-      >
-        <Download className="size-4" aria-hidden="true" />
-        <span className="hidden sm:inline">Export</span>
-      </Button>
+        {/* B4 일괄 업로드 버튼 - b4가 true일 때만 표시 */}
+        {b4 && (
+          <Button
+            variant="outline"
+            size="sm"
+            onClick={() => setBulkUploadDialogOpen(true)}
+            className="gap-2"
+          >
+            <Upload className="size-4" aria-hidden="true" />
+            <span className="hidden sm:inline">B4 업로드</span>
+          </Button>
+        )}
 
-      {/* Send to SHI 버튼 (공통) */}
-      <SendToSHIButton
-        documents={allDocuments}
-        onSyncComplete={handleSyncComplete}
-        projectType={projectType}
-      />
-    </div>
+        {/* Export 버튼 (공통) */}
+        <Button
+          variant="outline"
+          size="sm"
+          onClick={handleExport}
+          className="gap-2"
+        >
+          <Download className="size-4" aria-hidden="true" />
+          <span className="hidden sm:inline">Export</span>
+        </Button>
+
+        {/* Send to SHI 버튼 (공통) */}
+        <SendToSHIButton
+          documents={allDocuments}
+          onSyncComplete={handleSyncComplete}
+          projectType={projectType}
+        />
+      </div>
+
+      {/* B4 일괄 업로드 다이얼로그 */}
+      {b4 && (
+        <BulkB4UploadDialog
+          open={bulkUploadDialogOpen}
+          onOpenChange={setBulkUploadDialogOpen}
+          allDocuments={allDocuments}
+        />
+      )}
+    </>
   )
 }
\ No newline at end of file
-- 
cgit v1.2.3

