diff options
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.tsx | 16 |
1 files changed, 16 insertions, 0 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 06b2cc42..ac7ee184 100644 --- a/lib/tech-vendors/table/tech-vendors-table-toolbar-actions.tsx +++ b/lib/tech-vendors/table/tech-vendors-table-toolbar-actions.tsx @@ -20,6 +20,7 @@ import { TechVendor } from "@/db/schema/techVendors" import { ImportTechVendorButton } from "./import-button" import { exportTechVendorTemplate } from "./excel-template-download" import { AddVendorDialog } from "./add-vendor-dialog" +import { InviteTechVendorDialog } from "./invite-tech-vendor-dialog" interface TechVendorsTableToolbarActionsProps { table: Table<TechVendor> @@ -36,6 +37,13 @@ export function TechVendorsTableToolbarActions({ table, onRefresh }: TechVendors .rows .map(row => row.original); }, [table.getFilteredSelectedRowModel().rows]); + + // 초대 가능한 벤더들 (PENDING_INVITE 상태 + 이메일 있음) + const invitableVendors = React.useMemo(() => { + return selectedVendors.filter(vendor => + vendor.status === "PENDING_INVITE" && vendor.email + ); + }, [selectedVendors]); // 테이블의 모든 벤더 가져오기 (필터링된 결과) const allFilteredVendors = React.useMemo(() => { @@ -97,6 +105,14 @@ export function TechVendorsTableToolbarActions({ table, onRefresh }: TechVendors return ( <div className="flex items-center gap-2"> + {/* 초대 버튼 - 선택된 PENDING_REVIEW 벤더들이 있을 때만 표시 */} + {invitableVendors.length > 0 && ( + <InviteTechVendorDialog + vendors={invitableVendors} + onSuccess={handleVendorAddSuccess} + /> + )} + {/* 벤더 추가 다이얼로그 추가 */} <AddVendorDialog onSuccess={handleVendorAddSuccess} /> |
