'use strict';

exports.__esModule = true;

var _curry2 = require('lodash/curry');

var _curry3 = _interopRequireDefault(_curry2);

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 _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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

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

appendIcon.handledProps = [];
function proxy(type, config) {
  config.title = appendIcon(type, config.title);
  _rsuiteNotification.Notify[type](config);
}

var sendMessage = (0, _curry3.default)(proxy);

exports.default = {
  open: sendMessage('open'),
  info: sendMessage('info'),
  success: sendMessage('success'),
  warning: sendMessage('warning'),
  error: sendMessage('error'),
  remove: function remove(key) {
    _rsuiteNotification.Notify.remove(key);
  }
};