summaryrefslogtreecommitdiff
path: root/lib/rfqs/tbe-table/tbe-table-toolbar-actions.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-04-28 02:13:30 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-04-28 02:13:30 +0000
commitef4c533ebacc2cdc97e518f30e9a9350004fcdfb (patch)
tree345251a3ed0f4429716fa5edaa31024d8f4cb560 /lib/rfqs/tbe-table/tbe-table-toolbar-actions.tsx
parent9ceed79cf32c896f8a998399bf1b296506b2cd4a (diff)
~20250428 작업사항
Diffstat (limited to 'lib/rfqs/tbe-table/tbe-table-toolbar-actions.tsx')
-rw-r--r--lib/rfqs/tbe-table/tbe-table-toolbar-actions.tsx23
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/rfqs/tbe-table/tbe-table-toolbar-actions.tsx b/lib/rfqs/tbe-table/tbe-table-toolbar-actions.tsx
index 6a336135..a8f8ea82 100644
--- a/lib/rfqs/tbe-table/tbe-table-toolbar-actions.tsx
+++ b/lib/rfqs/tbe-table/tbe-table-toolbar-actions.tsx
@@ -28,18 +28,25 @@ export function VendorsTableToolbarActions({ table,rfqId }: VendorsTableToolbarA
fileInputRef.current?.click()
}
+ const invitationPossibeVendors = React.useMemo(() => {
+ return table
+ .getFilteredSelectedRowModel()
+ .rows
+ .map(row => row.original)
+ .filter(vendor => vendor.technicalResponseStatus === null);
+ }, [table.getFilteredSelectedRowModel().rows]);
+
return (
<div className="flex items-center gap-2">
- {table.getFilteredSelectedRowModel().rows.length > 0 ? (
- <InviteVendorsDialog
- vendors={table
- .getFilteredSelectedRowModel()
- .rows.map((row) => row.original)}
+ {invitationPossibeVendors.length > 0 &&
+ (
+ <InviteVendorsDialog
+ vendors={invitationPossibeVendors}
rfqId = {rfqId}
onSuccess={() => table.toggleAllRowsSelected(false)}
- />
- ) : null}
-
+ />
+ )
+ }
<Button
variant="outline"