import { SHOW_COPY_MODAL, CLOSE_COPY_MODAL, GET_COPY_MESSAGE, SHOW_DISCLAIMER_MODAL, CLOSE_DISCLAIMER_MODAL, GET_DISCLAIMER_MESSAGE, GET_VERSION } from "../types/copyRight";
import { showCopyModal, closeCopyModal, getMessage, showDisclatmerModal,  closeDisclatmerModal, getDisMessage, getVersion} from "../actions/copyRight";

const initState = {
  copyVisible: false,
  disVisible: false,
  number: "",
  date: "",
  content: [],
  disContent: [],
  hasNewVersion: false
};
export default function(state = initState, action) {
  switch (action.type) {
    case SHOW_COPY_MODAL:
      return showCopyModal(state, action);
    case CLOSE_COPY_MODAL:
      return closeCopyModal(state, action);
    case SHOW_DISCLAIMER_MODAL:
      return showDisclatmerModal(state, action);
    case CLOSE_DISCLAIMER_MODAL:
      return closeDisclatmerModal(state, action);
    case GET_COPY_MESSAGE:
      return getMessage(state, action);
    case GET_DISCLAIMER_MESSAGE:
      return getDisMessage(state, action);
    case GET_VERSION: 
      return getVersion(state, action)
    default:
      return state;
  }
}
