summaryrefslogtreecommitdiff
path: root/lib/tech-vendors/table/tech-vendors-table-toolbar-actions.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tech-vendors/table/tech-vendors-table-toolbar-actions.tsx')
-rw-r--r--lib/tech-vendors/table/tech-vendors-table-toolbar-actions.tsx19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/tech-vendors/table/tech-vendors-table-toolbar-actions.tsx b/lib/tech-vendors/table/tech-vendors-table-toolbar-actions.tsx
index 82383a3a..06b2cc42 100644
--- a/lib/tech-vendors/table/tech-vendors-table-toolbar-actions.tsx
+++ b/lib/tech-vendors/table/tech-vendors-table-toolbar-actions.tsx
@@ -2,7 +2,7 @@
import * as React from "react"
import { type Table } from "@tanstack/react-table"
-import { Download, FileSpreadsheet, Upload, Check, BuildingIcon, FileText } from "lucide-react"
+import { Download, FileSpreadsheet, FileText } from "lucide-react"
import { toast } from "sonner"
import { exportTableToExcel } from "@/lib/export"
@@ -19,12 +19,14 @@ import { exportVendorsWithRelatedData } from "./vendor-all-export"
import { TechVendor } from "@/db/schema/techVendors"
import { ImportTechVendorButton } from "./import-button"
import { exportTechVendorTemplate } from "./excel-template-download"
+import { AddVendorDialog } from "./add-vendor-dialog"
interface TechVendorsTableToolbarActionsProps {
table: Table<TechVendor>
+ onRefresh?: () => void
}
-export function TechVendorsTableToolbarActions({ table }: TechVendorsTableToolbarActionsProps) {
+export function TechVendorsTableToolbarActions({ table, onRefresh }: TechVendorsTableToolbarActionsProps) {
const [isExporting, setIsExporting] = React.useState(false);
// 선택된 모든 벤더 가져오기
@@ -82,9 +84,22 @@ export function TechVendorsTableToolbarActions({ table }: TechVendorsTableToolba
setIsExporting(false);
}
};
+
+ // 벤더 추가 성공 시 테이블 새로고침을 위한 핸들러
+ const handleVendorAddSuccess = () => {
+ // 테이블 데이터 리프레시
+ if (onRefresh) {
+ onRefresh();
+ } else {
+ window.location.reload(); // 간단한 새로고침 방법
+ }
+ };
return (
<div className="flex items-center gap-2">
+ {/* 벤더 추가 다이얼로그 추가 */}
+ <AddVendorDialog onSuccess={handleVendorAddSuccess} />
+
{/* Import 버튼 추가 */}
<ImportTechVendorButton
onSuccess={() => {