import React from 'react';
import { getUniqueId } from '@pisell/utils';
import { message } from "../pisellMessage";
import IconFont from "../iconfont";
import "./index.less";
var PisellToast = function PisellToast(props) {
  var content = props.content,
    duration = props.duration,
    showAction = props.showAction,
    actionText = props.actionText,
    onClose = props.onClose;
  var key = getUniqueId();
  message.open({
    key: key,
    content: /*#__PURE__*/React.createElement("div", {
      className: "pisell-toast-content"
    }, /*#__PURE__*/React.createElement("span", null, content), showAction && /*#__PURE__*/React.createElement("span", {
      className: "pisell-toast-action"
    }, actionText), /*#__PURE__*/React.createElement(IconFont, {
      type: 'pisell2-x-close',
      className: "pisell-toast-close",
      onClick: function onClick() {
        return message.destroy(key);
      }
    })),
    icon: null,
    duration: duration || 5,
    className: 'pisell-toast-wrap',
    onClose: onClose
  });
};
export default PisellToast;