export const state = () => ({
    searchOverlay: false,
    rightDrawer: {
        display: false,
        component: null,
        subMenu: null,
    },
});

export const mutations = {

    TOGGLE_SEARCH_OVERLAY: (state, value = null) => {
        state.searchOverlay = value
    },

    SWITCH_RIGHT_DRAWER: (state, value = true) => {

        if (typeof value === 'boolean') { state.rightDrawer.display = value }
        else {
            state.rightDrawer.component = value.component
            state.rightDrawer.subMenu = value.subMenu
            state.rightDrawer.display = true
        }
    },
};