diff options
Diffstat (limited to 'lib/rfqs/tbe-table')
| -rw-r--r-- | lib/rfqs/tbe-table/file-dialog.tsx | 2 | ||||
| -rw-r--r-- | lib/rfqs/tbe-table/tbe-table-columns.tsx | 43 | ||||
| -rw-r--r-- | lib/rfqs/tbe-table/tbe-table.tsx | 6 |
3 files changed, 22 insertions, 29 deletions
diff --git a/lib/rfqs/tbe-table/file-dialog.tsx b/lib/rfqs/tbe-table/file-dialog.tsx index 1d1a65ea..772eb930 100644 --- a/lib/rfqs/tbe-table/file-dialog.tsx +++ b/lib/rfqs/tbe-table/file-dialog.tsx @@ -76,7 +76,7 @@ export function TBEFileDialog({ // Download submitted file const downloadSubmittedFile = async (file: any) => { try { - const response = await fetch(`/api/file/${file.id}/download`) + const response = await fetch(`/api/tbe-download?path=${encodeURIComponent(file.filePath)}`) if (!response.ok) { throw new Error("Failed to download file") } diff --git a/lib/rfqs/tbe-table/tbe-table-columns.tsx b/lib/rfqs/tbe-table/tbe-table-columns.tsx index 29fbd5cd..0e9b7064 100644 --- a/lib/rfqs/tbe-table/tbe-table-columns.tsx +++ b/lib/rfqs/tbe-table/tbe-table-columns.tsx @@ -178,37 +178,30 @@ const commentsColumn: ColumnDef<VendorWithTbeFields> = { openCommentSheet(vendor.tbeId ?? 0) } - return ( - <div className="flex items-center justify-center"> + return ( <Button variant="ghost" size="sm" - className="h-8 w-8 p-0 group relative" + className="relative h-8 w-8 p-0 group" onClick={handleClick} - aria-label={commCount > 0 ? `View ${commCount} comments` : "Add comment"} + aria-label={ + commCount > 0 ? `View ${commCount} comments` : "No comments" + } > - <div className="flex items-center justify-center relative"> - {commCount > 0 ? ( - <> - <MessageSquare className="h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors" /> - <Badge - variant="secondary" - className="absolute -top-2 -right-2 h-4 min-w-4 text-xs px-1 flex items-center justify-center" - > - {commCount} - </Badge> - </> - ) : ( - <MessageSquare className="h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors" /> - )} - </div> - <span className="sr-only">{commCount > 0 ? `${commCount} Comments` : "Add Comment"}</span> + <MessageSquare className="h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors" /> + {commCount > 0 && ( + <Badge + variant="secondary" + className="pointer-events-none absolute -top-1 -right-1 h-4 min-w-[1rem] p-0 text-[0.625rem] leading-none flex items-center justify-center" + > + {commCount} + </Badge> + )} + <span className="sr-only"> + {commCount > 0 ? `${commCount} Comments` : "No Comments"} + </span> </Button> - {/* <span className="ml-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer" onClick={handleClick}> - {commCount > 0 ? `${commCount} Comments` : "Add Comment"} - </span> */} - </div> - ) + ) }, enableSorting: false, maxSize:80 diff --git a/lib/rfqs/tbe-table/tbe-table.tsx b/lib/rfqs/tbe-table/tbe-table.tsx index c385ca0b..41eff0dc 100644 --- a/lib/rfqs/tbe-table/tbe-table.tsx +++ b/lib/rfqs/tbe-table/tbe-table.tsx @@ -149,10 +149,10 @@ export function TbeTable({ promises, rfqId }: VendorsTableProps) { }) return ( - <> +<div style={{ maxWidth: '80vw' }}> <DataTable table={table} - > + > <DataTableAdvancedToolbar table={table} filterFields={advancedFilterFields} @@ -185,6 +185,6 @@ export function TbeTable({ promises, rfqId }: VendorsTableProps) { rfqId={rfqId} // Use the prop directly instead of data[0]?.rfqId onRefresh={handleRefresh} /> - </> + </div> ) }
\ No newline at end of file |
