@@ -3,14 +3,12 @@ import { Checkbox } from "@components/Checkbox";
33import { DataTable } from "@components/table/DataTable" ;
44import DataTableHeader from "@components/table/DataTableHeader" ;
55import DataTableRefreshButton from "@components/table/DataTableRefreshButton" ;
6- import { useLocalStorage } from "@hooks/useLocalStorage" ;
76import {
87 ColumnDef ,
98 RowSelectionState ,
109 SortingState ,
1110} from "@tanstack/react-table" ;
1211import useFetchApi from "@utils/api" ;
13- import { usePathname } from "next/navigation" ;
1412import React , { useState } from "react" ;
1513import { useSWRConfig } from "swr" ;
1614import { PostureCheck } from "@/interfaces/PostureCheck" ;
@@ -25,18 +23,14 @@ export default function PostureCheckBrowseTable({ onAdd }: Readonly<Props>) {
2523 const { data : postureChecks , isLoading } =
2624 useFetchApi < PostureCheck [ ] > ( "/posture-checks" ) ;
2725 const { mutate } = useSWRConfig ( ) ;
28- const path = usePathname ( ) ;
2926
3027 // 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+ ] ) ;
4034
4135 const [ selectedRows , setSelectedRows ] = useState < RowSelectionState > ( { } ) ;
4236
@@ -47,6 +41,7 @@ export default function PostureCheckBrowseTable({ onAdd }: Readonly<Props>) {
4741 rowSelection = { selectedRows }
4842 setRowSelection = { setSelectedRows }
4943 isLoading = { isLoading }
44+ keepStateInLocalStorage = { false }
5045 text = { "Posture Check" }
5146 sorting = { sorting }
5247 wrapperClassName = { "" }
0 commit comments