Skip to content

Commit

Permalink
refactor bottombar
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKarow committed Aug 18, 2023
1 parent bf3558d commit 93a3dab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/ui/components/data-portal/OrganizationTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className={classes.bottomBar}>
<Text variant='utility3'>
Showing {table.getFilteredRowModel().rows.length} of {table.getPreFilteredRowModel().rows.length}{' '}
results
Showing {filteredRowCount} of {preFilteredRowCount} results
</Text>
</div>
)
}

return (
<div className={classes.bottomBar}>
<Text variant='utility3'>{table.getFilteredRowModel().rows.length} results</Text>
<Text variant='utility3'>{preFilteredRowCount} results</Text>
</div>
)
}
Expand Down

0 comments on commit 93a3dab

Please sign in to comment.