import { create } from "zustand"; import { fetchCtpv, fetchSgg, fetchBIZ_SE_CD, fetchBIZ_TY_CD } from "./index"; import { type SelectDataType } from "@common/business_components"; export type BIZ_CD_TYPE = { lwpoCd: string, upCd: string, lwpoCdNm: string, unit: string, prntLwpoCd: null }; interface SnStoreState { ctpv: SelectDataType[]; sgg: SelectDataType[]; BIZ_SE_CD: BIZ_CD_TYPE[]; BIZ_TY_CD: BIZ_CD_TYPE[]; fetchCtpv: () => Promise; fetchSgg: () => Promise; fetchBIZ_SE_CD: () => Promise; fetchBIZ_TY_CD: () => Promise; } const useStore = create((set) => ({ ctpv: [], sgg: [], BIZ_SE_CD: [], BIZ_TY_CD: [], fetchCtpv: () => fetchCtpv(set), fetchSgg: () => fetchSgg(set), fetchBIZ_SE_CD: () => fetchBIZ_SE_CD(set), fetchBIZ_TY_CD: () => fetchBIZ_TY_CD(set), })); export default useStore;