import produce from 'immer';
import reducerRegistry from '~/Utils/reducerRegistry';

export const initialState = {
    search: {
      show: false,
    },
};

export default function reducer(state = initialState, action = {}) {
    return produce(state, draft => {
        switch (action.type) {
            case SEARCH_OPEN:
                draft.search.show = action.payload;
                break;
        }
    });
}

export const SEARCH_OPEN = 'GLOBAL_SEARCH/SEARCH_OPEN';
export const searchOpenAction = payload => ({ type: SEARCH_OPEN, payload });
