export const appReducers = {
  LOADING_START: (state, action) => {
    state.loading = true;
  },
  LOADING_END: (state, action) => {
    state.loading = false;
  },
  BACKDROP_SHOW: (state, action) => {
    state.backdrop = true;
  },
  BACKDROP_HIDE: (state, action) => {
    state.backdrop = false;
  },
  OPEN_MODAL: (state, action) => {
    state.modal = {
      modalState: true,
      modalContent: action.payload.content,
      modalTitle: action.payload.title,
      modalOnClose: action.payload.onClose,
      modalSize: action.payload.size,
    };
  },
  CLOSE_MODAL: (state) => {
    state.modal = { modalState: false, modalContent: null, modalTitle: null };
  },
  DRAWER: (state, action) => {
    state.drawer = {
      ...state.drawer,
      ...action.payload,
    };
  },

  RESET_TIME_TO_LOGOUT: (state, action) => {
    state.inActiveTime = 1800;
  },
};
