import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,CLEAR_MESSAGE,DIAG_SHOW } from "../types/print";
import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow } from "../actions/print";

const initState = {
  visible: false,
  preVisible: false,
  saveMessage: {},
  diagShow: false
};
export default function(state = initState, action) {
  switch (action.type) {
    case SHOW_PRINT_PREVIEW:
      return showPrintPreview(state, action);
    case CLOSE_PRINT_PREVIEW:
      return closePrintPreview(state, action);
    case SHOW_PREVIEW:
      return showPreview(state, action);
    case CLOSE_PREVIEW:
      return closePreview(state, action);
    case SAVE_MESSAGE:
      return saveMessage(state, action);
    case CLEAR_MESSAGE:
      return clearMessage(state, action);
    case DIAG_SHOW:
      return diagShow(state, action);
    default:
      return state;
  }
}
