diff options
Diffstat (limited to 'src/common/stores')
| -rw-r--r-- | src/common/stores/useResultStore.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/stores/useResultStore.ts b/src/common/stores/useResultStore.ts index d8da56c..09e8146 100644 --- a/src/common/stores/useResultStore.ts +++ b/src/common/stores/useResultStore.ts @@ -1,20 +1,25 @@ import { create } from "zustand"; +import { SelectOption } from "../types/select"; type State = { filter: { search: string; company: string; + show: string; }; + companies: SelectOption[]; }; type Action = { updateFilter: (name: string, value: string) => void; + setCompanies: (data: SelectOption[]) => void; }; export const useResultStore = create<State & Action>((set) => ({ filter: { search: "", company: "", + show: "1", }, updateFilter: (name, value) => set((state) => ({ @@ -23,4 +28,9 @@ export const useResultStore = create<State & Action>((set) => ({ [name]: value, }, })), + companies: [], + setCompanies: (data) => + set(() => ({ + companies: data, + })), })); |
