diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-28 09:19:42 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-28 09:19:42 +0000 |
| commit | 50ae0b8f02c034e60d4cbb504620dfa1575a836f (patch) | |
| tree | 24c661a0c7354e15ad56e2bded4d300bd7fd2b41 /lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table-toolbar.tsx | |
| parent | 738f956aa61264ffa761e30398eca23393929f8c (diff) | |
(박서영) 설계 document Numbering Rule 개발-최겸 업로드
Diffstat (limited to 'lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table-toolbar.tsx')
| -rw-r--r-- | lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table-toolbar.tsx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table-toolbar.tsx b/lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table-toolbar.tsx new file mode 100644 index 00000000..77cbea01 --- /dev/null +++ b/lib/docu-list-rule/combo-box-settings/table/combo-box-settings-table-toolbar.tsx @@ -0,0 +1,33 @@ +"use client" + +import * as React from "react" +import { type Table } from "@tanstack/react-table" + +import { DeleteComboBoxSettingsDialog } from "./delete-combo-box-settings-dialog" +import { codeGroups } from "@/db/schema/codeGroups" + +interface ComboBoxSettingsTableToolbarActionsProps { + table: Table<typeof codeGroups.$inferSelect> + onSuccess?: () => void +} + +export function ComboBoxSettingsTableToolbarActions({ table, onSuccess }: ComboBoxSettingsTableToolbarActionsProps) { + return ( + <div className="flex items-center gap-2"> + {/** 1) 선택된 로우가 있으면 삭제 다이얼로그 */} + {table.getFilteredSelectedRowModel().rows.length > 0 ? ( + <DeleteComboBoxSettingsDialog + codeGroups={table + .getFilteredSelectedRowModel() + .rows.map((row) => row.original)} + onSuccess={() => { + table.toggleAllRowsSelected(false) + onSuccess?.() + }} + /> + ) : null} + + + </div> + ) +}
\ No newline at end of file |
