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

export const initialState = {
    picker: {
      show: false,
      month: new Date(),
      onChange: () => {},
    },
};

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

export const SHOW = 'GLOBAL_MONTH_PICKER/SHOW';
export const showAction = payload => ({ type: SHOW, payload });
