import { create } from "zustand"; import { getGeoData, getCmsData } from "@/components/lib/api"; import { fetchCtpvSggData, fetchBIZ_SE_CD, fetchBIZ_TY_CD } from "./index"; interface Option { id: number, name: string } export type BIZ_CD_TYPE = { lwpoCd: string, upCd: string, lwpoCdNm: string, unit: string, prntLwpoCd: null }; interface SnStoreState { ctpv: Option[]; sgg: Option[]; BIZ_SE_CD: BIZ_CD_TYPE[]; BIZ_TY_CD: BIZ_CD_TYPE[]; fetchCtpvSggData: () => Promise; fetchBIZ_SE_CD: () => Promise; fetchBIZ_TY_CD: () => Promise; } const useStore = create((set) => ({ ctpv: [], sgg: [], BIZ_SE_CD: [], BIZ_TY_CD: [], fetchCtpvSggData: () => fetchCtpvSggData(set), fetchBIZ_SE_CD: () => fetchBIZ_SE_CD(set), fetchBIZ_TY_CD: () => fetchBIZ_TY_CD(set), })); export default useStore;