import { SHOW_NOTIFICATION, CLEAR_NOTIFICATION, LIFTED_ACTION, ERROR } from '../constants/actionTypes';
export function notification() {
  let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  let action = arguments.length > 1 ? arguments[1] : undefined;
  switch (action.type) {
    case SHOW_NOTIFICATION:
      return action.notification;
    case ERROR:
      return {
        type: 'error',
        message: action.payload
      };
    case LIFTED_ACTION:
      return null;
    case CLEAR_NOTIFICATION:
      return null;
    default:
      return state;
  }
}