From 50ae0b8f02c034e60d4cbb504620dfa1575a836f Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 28 Jul 2025 09:19:42 +0000
Subject: (박서영) 설계 document Numbering Rule 개발-최겸 업로드
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../table/document-class-options-table-toolbar.tsx | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 lib/docu-list-rule/document-class/table/document-class-options-table-toolbar.tsx

(limited to 'lib/docu-list-rule/document-class/table/document-class-options-table-toolbar.tsx')

diff --git a/lib/docu-list-rule/document-class/table/document-class-options-table-toolbar.tsx b/lib/docu-list-rule/document-class/table/document-class-options-table-toolbar.tsx
new file mode 100644
index 00000000..5044d90d
--- /dev/null
+++ b/lib/docu-list-rule/document-class/table/document-class-options-table-toolbar.tsx
@@ -0,0 +1,43 @@
+"use client"
+
+import * as React from "react"
+import { type Table } from "@tanstack/react-table"
+
+import { DocumentClassOptionAddDialog } from "./document-class-option-add-dialog"
+import { DeleteDocumentClassOptionDialog } from "./delete-document-class-option-dialog"
+import { documentClasses, documentClassOptions } from "@/db/schema/documentClasses"
+
+interface DocumentClassOptionsTableToolbarActionsProps<TData> {
+  table: Table<TData>
+  selectedDocumentClass: typeof documentClasses.$inferSelect | null
+  onSuccess?: () => void
+}
+
+export function DocumentClassOptionsTableToolbarActions<TData>({
+  table,
+  selectedDocumentClass,
+  onSuccess,
+}: DocumentClassOptionsTableToolbarActionsProps<TData>) {
+  const selectedRows = table.getFilteredSelectedRowModel().rows
+  const selectedOptions = selectedRows.map((row) => row.original as typeof documentClassOptions.$inferSelect)
+
+  return (
+    <div className="flex items-center gap-2">
+      {/** 선택된 로우가 있으면 삭제 다이얼로그 */}
+      {selectedOptions.length > 0 ? (
+        <DeleteDocumentClassOptionDialog
+          options={selectedOptions}
+          onSuccess={() => {
+            table.toggleAllRowsSelected(false)
+            onSuccess?.()
+          }}
+        />
+      ) : null}
+
+      <DocumentClassOptionAddDialog
+        selectedDocumentClass={selectedDocumentClass}
+        onSuccess={onSuccess}
+      />
+    </div>
+  )
+} 
\ No newline at end of file
-- 
cgit v1.2.3

