@@ -2,6 +2,7 @@ import { ConfigSummary } from "@flanksource-ui/api/types/configs";
2
2
import { Badge } from "@flanksource-ui/ui/Badge/Badge" ;
3
3
import { CountBadge } from "@flanksource-ui/ui/Badge/CountBadge" ;
4
4
import { DataTable } from "@flanksource-ui/ui/DataTable" ;
5
+ import useReactTableSortState from "@flanksource-ui/ui/DataTable/Hooks/useReactTableSortState" ;
5
6
import { CellContext , ColumnDef , Row } from "@tanstack/react-table" ;
6
7
import { useCallback , useMemo } from "react" ;
7
8
import { BiLabel } from "react-icons/bi" ;
@@ -266,6 +267,8 @@ export default function ConfigSummaryList({
266
267
return [ ...newColumns , ...configSummaryColumns ] ;
267
268
} , [ groupBy , groupByTags ] ) ;
268
269
270
+ const [ sortState , updateSortState ] = useReactTableSortState ( ) ;
271
+
269
272
return (
270
273
< DataTable
271
274
stickyHead
@@ -278,6 +281,9 @@ export default function ConfigSummaryList({
278
281
hiddenColumns = {
279
282
groupBy . length > 1 ? groupBy . slice ( 0 , groupBy . length - 1 ) : undefined
280
283
}
284
+ enableServerSideSorting
285
+ onTableSortByChanged = { updateSortState }
286
+ tableSortByState = { sortState }
281
287
handleRowClick = { handleRowClick }
282
288
tableStyle = { { borderSpacing : "0" } }
283
289
isLoading = { isLoading }
0 commit comments