import { SHOW_CONFIG_MODAL, CLOSE_CONFIG_MODAL, CONFIRM_TYPE ,MODE_CHANGE_FAIL} from "../types/typeConfig";
import { showConfigModal, closeConfigModal, changeType, confirmType,modeChangeFail } from "../actions/typeConfig";
import config from '@config/index';

const initState = {
  visible: false,
  typeConfig: config.defaultValue.mode, // 0:智能推送模式， 1：纯文本模式,用于切换选中状态
  failed:false
};
export default function(state = initState, action) {
  switch (action.type) {
    case SHOW_CONFIG_MODAL:
      return showConfigModal(state, action);
    case CLOSE_CONFIG_MODAL:
      return closeConfigModal(state, action);
    case CONFIRM_TYPE:
      return confirmType(state, action);
    case MODE_CHANGE_FAIL:
      return modeChangeFail(state,action);
    default:
      return state;
  }
}
