Skip to content

Commit

Permalink
fix: use server side sorting for config summary
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed May 23, 2024
1 parent c5572b4 commit 346e7d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Configs/ConfigSummary/ConfigSummaryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
import { Badge } from "@flanksource-ui/ui/Badge/Badge";
import { CountBadge } from "@flanksource-ui/ui/Badge/CountBadge";
import { DataTable } from "@flanksource-ui/ui/DataTable";
import useReactTableSortState from "@flanksource-ui/ui/DataTable/Hooks/useReactTableSortState";
import { CellContext, ColumnDef, Row } from "@tanstack/react-table";
import { useCallback, useMemo } from "react";
import { BiLabel } from "react-icons/bi";
Expand Down Expand Up @@ -318,6 +319,8 @@ export default function ConfigSummaryList({
return [...newColumns, ...configSummaryColumns];
}, [groupBy, groupByTags]);

const [sortState, updateSortState] = useReactTableSortState();

return (
<DataTable
stickyHead
Expand All @@ -330,6 +333,9 @@ export default function ConfigSummaryList({
hiddenColumns={
groupBy.length > 1 ? groupBy.slice(0, groupBy.length - 1) : undefined
}
enableServerSideSorting
onTableSortByChanged={updateSortState}
tableSortByState={sortState}
handleRowClick={handleRowClick}
tableStyle={{ borderSpacing: "0" }}
isLoading={isLoading}
Expand Down

0 comments on commit 346e7d0

Please sign in to comment.