Skip to content

Commit 346e7d0

Browse files
committed
fix: use server side sorting for config summary
1 parent c5572b4 commit 346e7d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/Configs/ConfigSummary/ConfigSummaryList.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
import { Badge } from "@flanksource-ui/ui/Badge/Badge";
77
import { CountBadge } from "@flanksource-ui/ui/Badge/CountBadge";
88
import { DataTable } from "@flanksource-ui/ui/DataTable";
9+
import useReactTableSortState from "@flanksource-ui/ui/DataTable/Hooks/useReactTableSortState";
910
import { CellContext, ColumnDef, Row } from "@tanstack/react-table";
1011
import { useCallback, useMemo } from "react";
1112
import { BiLabel } from "react-icons/bi";
@@ -318,6 +319,8 @@ export default function ConfigSummaryList({
318319
return [...newColumns, ...configSummaryColumns];
319320
}, [groupBy, groupByTags]);
320321

322+
const [sortState, updateSortState] = useReactTableSortState();
323+
321324
return (
322325
<DataTable
323326
stickyHead
@@ -330,6 +333,9 @@ export default function ConfigSummaryList({
330333
hiddenColumns={
331334
groupBy.length > 1 ? groupBy.slice(0, groupBy.length - 1) : undefined
332335
}
336+
enableServerSideSorting
337+
onTableSortByChanged={updateSortState}
338+
tableSortByState={sortState}
333339
handleRowClick={handleRowClick}
334340
tableStyle={{ borderSpacing: "0" }}
335341
isLoading={isLoading}

0 commit comments

Comments
 (0)