Add copilot to every page
This commit is contained in:
@@ -51,6 +51,7 @@ import captainDocuments from './captain/document';
|
||||
import captainResponses from './captain/response';
|
||||
import captainInboxes from './captain/inboxes';
|
||||
import captainBulkActions from './captain/bulkActions';
|
||||
import uiState from './modules/uiState';
|
||||
const plugins = [];
|
||||
|
||||
export default createStore({
|
||||
@@ -106,6 +107,7 @@ export default createStore({
|
||||
captainResponses,
|
||||
captainInboxes,
|
||||
captainBulkActions,
|
||||
uiState,
|
||||
},
|
||||
plugins,
|
||||
});
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
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,
|
||||
};
|
||||
Reference in New Issue
Block a user