import { create } from "zustand";

interface ModuleStore {
    activeModule: string;
    setActiveModule: (module: string) => void;
}

const useModuleStore = create<ModuleStore>((set) => ({
    activeModule: "builder", // Initial state
    setActiveModule: (module) => set({ activeModule: module }), // Update state
}));

export default useModuleStore;

// New store for subModule

type SubModule = "properties" | "simulations" | "mechanics" | "analysis" | "zoneProperties" | "resourceManagement";

interface SubModuleStore {
    subModule: SubModule;
    setSubModule: (subModule: SubModule) => void;
}

const useSubModuleStore = create<SubModuleStore>((set) => ({
    subModule: "properties", // Initial subModule state
    setSubModule: (value) => set({ subModule: value }), // Update subModule state
}));

export { useSubModuleStore };
