const state = {
    currentProjectId: null,
    currentProjectName: ''
  }
  
  const mutations = {
    SET_CURRENT_PROJECT: (state, { id, name }) => {
      state.currentProjectId = id
      state.currentProjectName = name
    }
  }
  
  const actions = {
    setCurrentProject({ commit }, project) {
      commit('SET_CURRENT_PROJECT', project)
      // 保存到 localStorage，以便刷新后保持状态
      localStorage.setItem('currentProject', JSON.stringify(project))
    }
  }
  
  export default {
    namespaced: true,
    state,
    mutations,
    actions
  }