diff options
Diffstat (limited to 'lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx')
| -rw-r--r-- | lib/vendor-document-list/ship/enhanced-doc-table-toolbar-actions.tsx | 77 |
1 files changed, 52 insertions, 25 deletions
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 |
