complete installation device pagination

This commit is contained in:
Alihaghighattalab
2024-08-22 17:07:33 +03:30
parent 1b96b0dc2c
commit 4b4c546aaa
11 changed files with 176 additions and 41 deletions
+23
View File
@@ -0,0 +1,23 @@
import { create } from 'zustand';
import { TableParams } from '../types';
type ZustandState = {
params: TableParams;
updateParams: (newParams: Partial<TableParams>) => void;
};
export const useParamsStore = create<ZustandState>((set) => ({
params: {
page: 1,
rows: 10,
search: "",
},
updateParams: (newParams: Partial<TableParams>) =>
set((state) => ({
...state,
params: {
...state.params,
...newParams,
},
})),
}));