From 93a3dab36b78e91340205a462bb7405af10452b1 Mon Sep 17 00:00:00 2001 From: Joe Karow <58997957+JoeKarow@users.noreply.github.com> Date: Fri, 18 Aug 2023 19:32:47 -0400 Subject: [PATCH] refactor bottombar --- .../ui/components/data-portal/OrganizationTable.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/ui/components/data-portal/OrganizationTable.tsx b/packages/ui/components/data-portal/OrganizationTable.tsx index 5f9375e902..3b833479da 100644 --- a/packages/ui/components/data-portal/OrganizationTable.tsx +++ b/packages/ui/components/data-portal/OrganizationTable.tsx @@ -126,19 +126,22 @@ const ToolbarButtons = ({ columnFilters, setColumnFilters }: ToolbarButtonsProps const BottomBar = ({ table }: BottomBarProps) => { const { classes } = useStyles() - if (table.getPreFilteredRowModel().rows.length !== table.getFilteredRowModel().rows.length) { + const filteredRowCount = table.getFilteredRowModel().rows.length + const preFilteredRowCount = table.getPreFilteredRowModel().rows.length + + if (preFilteredRowCount !== filteredRowCount) { return (
- Showing {table.getFilteredRowModel().rows.length} of {table.getPreFilteredRowModel().rows.length}{' '} - results + Showing {filteredRowCount} of {preFilteredRowCount} results
) } + return (
- {table.getFilteredRowModel().rows.length} results + {preFilteredRowCount} results
) }