diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-28 02:13:30 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-28 02:13:30 +0000 |
| commit | ef4c533ebacc2cdc97e518f30e9a9350004fcdfb (patch) | |
| tree | 345251a3ed0f4429716fa5edaa31024d8f4cb560 /lib/tbe/table/tbe-table-toolbar-actions.tsx | |
| parent | 9ceed79cf32c896f8a998399bf1b296506b2cd4a (diff) | |
~20250428 작업사항
Diffstat (limited to 'lib/tbe/table/tbe-table-toolbar-actions.tsx')
| -rw-r--r-- | lib/tbe/table/tbe-table-toolbar-actions.tsx | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/lib/tbe/table/tbe-table-toolbar-actions.tsx b/lib/tbe/table/tbe-table-toolbar-actions.tsx index 6a336135..cf6a041e 100644 --- a/lib/tbe/table/tbe-table-toolbar-actions.tsx +++ b/lib/tbe/table/tbe-table-toolbar-actions.tsx @@ -28,19 +28,31 @@ export function VendorsTableToolbarActions({ table,rfqId }: VendorsTableToolbarA fileInputRef.current?.click() } + // 선택된 행이 있는 경우 rfqId 확인 + const uniqueRfqIds = table.getFilteredSelectedRowModel().rows.length > 0 + ? [...new Set(table.getFilteredSelectedRowModel().rows.map(row => row.original.rfqId))] + : []; + + const hasMultipleRfqIds = uniqueRfqIds.length > 1; + + 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 ? ( + {invitationPossibeVendors.length > 0 && ( <InviteVendorsDialog - vendors={table - .getFilteredSelectedRowModel() - .rows.map((row) => row.original)} - rfqId = {rfqId} + vendors={invitationPossibeVendors} + rfqId={rfqId} onSuccess={() => table.toggleAllRowsSelected(false)} + hasMultipleRfqIds={hasMultipleRfqIds} /> - ) : null} - - + )} <Button variant="outline" size="sm" |
