36 lines
622 B
JavaScript
36 lines
622 B
JavaScript
const initialState = {
|
|
isCopilotSidebarOpen: false,
|
|
// Add more UI settings here as needed
|
|
};
|
|
|
|
const types = {
|
|
SET_UI_STATE: 'SET_UI_STATE',
|
|
};
|
|
|
|
const mutations = {
|
|
[types.SET_UI_STATE](state, { key, value }) {
|
|
state[key] = value;
|
|
},
|
|
};
|
|
|
|
const getters = {
|
|
getUIState: state => key => state[key],
|
|
};
|
|
|
|
const actions = {
|
|
toggle({ commit, state }, key) {
|
|
commit(types.SET_UI_STATE, { key, value: !state[key] });
|
|
},
|
|
set({ commit }, key, value) {
|
|
commit(types.SET_UI_STATE, { key, value });
|
|
},
|
|
};
|
|
|
|
export default {
|
|
namespaced: true,
|
|
state: initialState,
|
|
getters,
|
|
mutations,
|
|
actions,
|
|
};
|