@@ -3,14 +3,12 @@ import { Checkbox } from "@components/Checkbox";
3
3
import { DataTable } from "@components/table/DataTable" ;
4
4
import DataTableHeader from "@components/table/DataTableHeader" ;
5
5
import DataTableRefreshButton from "@components/table/DataTableRefreshButton" ;
6
- import { useLocalStorage } from "@hooks/useLocalStorage" ;
7
6
import {
8
7
ColumnDef ,
9
8
RowSelectionState ,
10
9
SortingState ,
11
10
} from "@tanstack/react-table" ;
12
11
import useFetchApi from "@utils/api" ;
13
- import { usePathname } from "next/navigation" ;
14
12
import React , { useState } from "react" ;
15
13
import { useSWRConfig } from "swr" ;
16
14
import { PostureCheck } from "@/interfaces/PostureCheck" ;
@@ -25,18 +23,14 @@ export default function PostureCheckBrowseTable({ onAdd }: Readonly<Props>) {
25
23
const { data : postureChecks , isLoading } =
26
24
useFetchApi < PostureCheck [ ] > ( "/posture-checks" ) ;
27
25
const { mutate } = useSWRConfig ( ) ;
28
- const path = usePathname ( ) ;
29
26
30
27
// Default sorting state of the table
31
- const [ sorting , setSorting ] = useLocalStorage < SortingState > (
32
- "netbird-table-sort" + path ,
33
- [
34
- {
35
- id : "name" ,
36
- desc : true ,
37
- } ,
38
- ] ,
39
- ) ;
28
+ const [ sorting , setSorting ] = useState < SortingState > ( [
29
+ {
30
+ id : "name" ,
31
+ desc : true ,
32
+ } ,
33
+ ] ) ;
40
34
41
35
const [ selectedRows , setSelectedRows ] = useState < RowSelectionState > ( { } ) ;
42
36
@@ -47,6 +41,7 @@ export default function PostureCheckBrowseTable({ onAdd }: Readonly<Props>) {
47
41
rowSelection = { selectedRows }
48
42
setRowSelection = { setSelectedRows }
49
43
isLoading = { isLoading }
44
+ keepStateInLocalStorage = { false }
50
45
text = { "Posture Check" }
51
46
sorting = { sorting }
52
47
wrapperClassName = { "" }
0 commit comments