// src/stores/modules/mode.ts
import { defineStore } from 'pinia';

// export const useModeStore = defineStore('mode', {
//   state: () => ({
//     currentMode: '' as string,
//   }),
//   actions: {
//     setCurrentMode(modeName: string) {
//       this.currentMode = modeName;
//     },
//   },
// });


export const useModeStore = defineStore('mode', {
    state: () => ({
      currentMode: localStorage.getItem('currentMode') || '' as string,
    }),
    actions: {
      setCurrentMode(modeName: string) {
        this.currentMode = modeName;
        localStorage.setItem('currentMode', modeName); // 保存到 localStorage
      },
    },
  });

  export const useAppSceneStore = defineStore('scene', {
    state: () => ({
      currentScene: localStorage.getItem('currentScene') || '' as string,
    }),
    actions: {
      setCurrentMode(sceneName: string) {
        this.currentScene = sceneName;
        localStorage.setItem('currentScene', sceneName); // 保存到 localStorage
      },
    },
  });

