summaryrefslogtreecommitdiff
path: root/lib/rfqs/tbe-table/tbe-table-columns.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rfqs/tbe-table/tbe-table-columns.tsx')
-rw-r--r--lib/rfqs/tbe-table/tbe-table-columns.tsx43
1 files changed, 18 insertions, 25 deletions
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