mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 15:25:46 +00:00
refactor(FE): Integrate UI store and pathname sync in master-data tables
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useMemo, useState } from 'react';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import useSWR from 'swr';
|
||||
import { CellContext, ColumnDef, SortingState } from '@tanstack/react-table';
|
||||
import toast from 'react-hot-toast';
|
||||
@@ -18,6 +18,8 @@ import ProductionStandardTableSkeleton from '@/components/pages/master-data/prod
|
||||
import { ProductionStandard } from '@/types/api/master-data/production-standard';
|
||||
import { ProductionStandardApi } from '@/services/api/master-data';
|
||||
import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { useUiStore } from '@/stores/ui/ui.store';
|
||||
|
||||
const RowOptionsMenu = ({
|
||||
popoverPosition = 'bottom',
|
||||
@@ -99,6 +101,13 @@ const RowOptionsMenu = ({
|
||||
};
|
||||
|
||||
const ProductionStandardTable = () => {
|
||||
const { setTableState } = useUiStore();
|
||||
const pathname = usePathname();
|
||||
|
||||
useEffect(() => {
|
||||
setTableState('production-standard-table', pathname);
|
||||
}, [pathname]);
|
||||
|
||||
const [sorting, setSorting] = useState<SortingState>([]);
|
||||
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user