diff --git a/src/components/pages/production/project-flock/ProjectFlockTable.tsx b/src/components/pages/production/project-flock/ProjectFlockTable.tsx index 17d5227b..e3018e38 100644 --- a/src/components/pages/production/project-flock/ProjectFlockTable.tsx +++ b/src/components/pages/production/project-flock/ProjectFlockTable.tsx @@ -23,7 +23,6 @@ import { Icon } from '@iconify/react'; import { CellContext, ColumnDef, SortingState } from '@tanstack/react-table'; import { useRouter, usePathname } from 'next/navigation'; import { ChangeEventHandler, useEffect, useMemo, useState } from 'react'; -import { useUiStore } from '@/stores/ui/ui.store'; import toast from 'react-hot-toast'; import useSWR from 'swr'; import { useFormik } from 'formik'; @@ -148,7 +147,6 @@ const RowOptionsMenu = ({ }; const ProjectFlockTable = ({ refresh }: { refresh?: () => void }) => { - const { searchValue, setSearchValue, setTableState } = useUiStore(); const pathname = usePathname(); const isSuccess = useProjectFlockStore((s) => s.isSuccess); @@ -185,7 +183,11 @@ const ProjectFlockTable = ({ refresh }: { refresh?: () => void }) => { category: 'category', period: 'period', }, + + persist: true, + storeName: 'project-flock-table', }); + const router = useRouter(); // ===== State ===== @@ -425,18 +427,11 @@ const ProjectFlockTable = ({ refresh }: { refresh?: () => void }) => { setIsDeleteLoading(false); setRowSelection({}); }; - useEffect(() => { - updateFilter('search', searchValue); - }, [searchValue, updateFilter]); - - useEffect(() => { - setTableState('project-flock-table', pathname); - }, [pathname, setTableState]); const searchChangeHandler: ChangeEventHandler = (e) => { - setSearchValue(e.target.value); updateFilter('search', e.target.value); }; + const confirmApprovalHandler = async ( notes: string, approvalAction: 'APPROVED' | 'REJECTED'