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

export const initialState = {
    camera: {
      show: false,
      onTakePicture: (picture) => {},
      onCancel: () => {}
    },
};

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

export const SHOW_CAMERA = 'GLOBAL_CAMERA/SHOW_CAMERA';
export const showCameraAction = payload => ({ type: SHOW_CAMERA, camera: payload });
