"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.notification = notification;
var _actionTypes = require("../constants/actionTypes");
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 _actionTypes.SHOW_NOTIFICATION:
      return action.notification;
    case _actionTypes.ERROR:
      return {
        type: 'error',
        message: action.payload
      };
    case _actionTypes.LIFTED_ACTION:
      return null;
    case _actionTypes.CLEAR_NOTIFICATION:
      return null;
    default:
      return state;
  }
}