From c72d0897f7b37843109c86f61d97eba05ba3ca0d Mon Sep 17 00:00:00 2001 From: dujinkim Date: Fri, 13 Jun 2025 07:08:01 +0000 Subject: (대표님) 20250613 16시 08분 b-rfq, document 등 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/b-rfq/attachment/attachment-toolbar-action.tsx | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 lib/b-rfq/attachment/attachment-toolbar-action.tsx (limited to 'lib/b-rfq/attachment/attachment-toolbar-action.tsx') diff --git a/lib/b-rfq/attachment/attachment-toolbar-action.tsx b/lib/b-rfq/attachment/attachment-toolbar-action.tsx new file mode 100644 index 00000000..e078ea66 --- /dev/null +++ b/lib/b-rfq/attachment/attachment-toolbar-action.tsx @@ -0,0 +1,60 @@ +"use client" + +import * as React from "react" +import { type Table } from "@tanstack/react-table" + +import { AddAttachmentDialog } from "./add-attachment-dialog" +import { ConfirmDocumentsDialog } from "./confirm-documents-dialog" +import { TbeRequestDialog } from "./tbe-request-dialog" +import { DeleteAttachmentsDialog } from "./delete-attachment-dialog" + +interface RfqAttachmentsTableToolbarActionsProps { + table: Table + rfqId: number +} + +export function RfqAttachmentsTableToolbarActions({ + table, + rfqId +}: RfqAttachmentsTableToolbarActionsProps) { + + // 선택된 행들 가져오기 + const selectedRows = table.getFilteredSelectedRowModel().rows + const selectedAttachments = selectedRows.map((row) => row.original) + const selectedCount = selectedRows.length + + return ( +
+ {/** 선택된 로우가 있으면 삭제 다이얼로그 */} + {selectedCount > 0 && ( + table.toggleAllRowsSelected(false)} + /> + )} + + {/** 새 첨부 추가 다이얼로그 */} + + + {/** 문서 확정 다이얼로그 */} + { + // 성공 후 필요한 작업 (예: 페이지 새로고침) + window.location.reload() + }} + /> + + {/** TBE 요청 다이얼로그 (선택된 행이 있을 때만 활성화) */} + { + // 선택 해제 및 페이지 새로고침 + table.toggleAllRowsSelected(false) + window.location.reload() + }} + /> +
+ ) +} \ No newline at end of file -- cgit v1.2.3