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

export const initialState = {
    selector: {
      showSelector: false,
      type: 'IMAGE',
      onSelect: (action) => {},
    },
};

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

export const SHOW_SELECTOR = 'GLOBAL_UPLOAD_FILE/SHOW_SELECTOR';
export const showSelectorAction = payload => ({ type: SHOW_SELECTOR, payload });
