'use strict';

exports.__esModule = true;

var _react = require('react');

var React = _interopRequireWildcard(_react);

var _rsuiteNotification = require('rsuite-notification');

var _Icon = require('./Icon');

var _Icon2 = _interopRequireDefault(_Icon);

var _constants = require('./utils/constants');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function appendIcon(type, content) {
  return React.createElement(
    'div',
    null,
    React.createElement(_Icon2.default, { icon: _constants.STATUS_ICON_NAMES[type] }),
    content
  );
}

appendIcon.handledProps = [];
function proxy(type) {
  return function (content, duration, onClose) {
    _rsuiteNotification.Alert[type](appendIcon(type, content), duration, onClose);
  };
}

exports.default = {
  info: proxy('info'),
  success: proxy('success'),
  warning: proxy('warning'),
  error: proxy('error'),
  config: function config(options) {
    _rsuiteNotification.Alert.config(options);
  }
};