Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore(data-table): format total count and pages in select all banner (#12353)

marliessophiefc75ea35f20d
diff --git a/web/src/components/table/data-table-multi-select-actions/data-table-select-all-banner.tsx b/web/src/components/table/data-table-multi-select-actions/data-table-select-all-banner.tsx
index a6bbbe5c54..93a0cc65ff 100644
--- a/web/src/components/table/data-table-multi-select-actions/data-table-select-all-banner.tsx
+++ b/web/src/components/table/data-table-multi-select-actions/data-table-select-all-banner.tsx
@@ -1,5 +1,6 @@
import { type MultiSelect } from "@/src/components/table/data-table-toolbar";
import { Button } from "@/src/components/ui/button";
+import { numberFormatter } from "@/src/utils/numbers";
export function DataTableSelectAllBanner({
selectAll,
@@ -8,12 +9,17 @@ export function DataTableSelectAllBanner({
pageSize,
totalCount,
}: MultiSelect) {
+ const totalPages = totalCount ? Math.ceil(totalCount / pageSize) : 0;
+
return (
<div className="mb-2 flex flex-wrap items-center justify-center gap-2 rounded-sm bg-input p-2 @container">
{selectAll ? (
<span className="text-sm">
- All <span className="font-semibold">{totalCount}</span> items are
- selected.{" "}
+ All{" "}
+ <span className="font-semibold">
+ {numberFormatter(totalCount ?? 0, 0)}
+ </span>{" "}
+ items are selected.{" "}
<Button
variant="ghost"
className="h-auto p-0 font-semibold text-accent-dark-blue hover:text-accent-dark-blue/80"
@@ -36,7 +42,8 @@ export function DataTableSelectAllBanner({
setSelectAll(true);
}}
>
- Select all {totalCount} items
+ Select all {numberFormatter(totalCount ?? 0, 0)} items across{" "}
+ {numberFormatter(totalPages, 0)} pages
</Button>
</span>
)}