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
interface SubModuleStore {
  subModule: string;
  setSubModule: (subModule: string) => void;
}

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

export { useSubModuleStore };

interface ThreeDState {
  toggleThreeD: boolean;
  setToggleThreeD: (value: boolean) => void;
}

// Create the Zustand store
const useThreeDStore = create<ThreeDState>((set) => ({
  toggleThreeD: true, // Initial state
  setToggleThreeD: (value) => set({ toggleThreeD: value }), // Action to update the state
}));

export { useThreeDStore };