"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.RenderError = RenderError;
exports.RenderSuccess = RenderSuccess;
exports.RenderWarning = RenderWarning;

var _react = _interopRequireDefault(require("react"));

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _style = require("../style");

var _templateObject, _templateObject2, _templateObject3;

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

function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

var Success = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t/* color: #00b70d; */\n\tdisplay: flex;\n\talign-items: center;\n\tword-break: break-all;\n\tline-height: 22px;\n\t.icon {\n\t\talign-self: flex-start;\n\t\tmargin-top: 4px;\n\t}\n\t/* color: #5AD8A6; */\n"])));

var Warning = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tcolor: #F6BD16;\n"])));

var Error = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\tdisplay: flex;\n\talign-items: center;\n\tword-break: break-all;\n\tline-height: 22px;\n\t.icon {\n\t\talign-self: flex-start;\n\t\tmargin-top: 4px;\n\t}\n\t/* color: #efa400; */\n"])));

function RenderSuccess(msg, key) {
  var canClose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  var instantce = arguments.length > 3 ? arguments[3] : undefined;
  return /*#__PURE__*/_react["default"].createElement(_style.ToastWrapper, {
    className: "success-toast"
  }, /*#__PURE__*/_react["default"].createElement(Success, null, /*#__PURE__*/_react["default"].createElement("span", {
    className: "icon tu-icon-yiwancheng"
  }), msg, canClose && /*#__PURE__*/_react["default"].createElement(_style.CloseBtn, {
    className: "tu-icon-canceled",
    onClick: function onClick() {
      instantce.removeNotice(key);
    }
  })));
}

function RenderWarning(msg, key) {
  var canClose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  var instantce = arguments.length > 3 ? arguments[3] : undefined;
  return /*#__PURE__*/_react["default"].createElement(_style.ToastWrapper, {
    className: "warning-toast"
  }, /*#__PURE__*/_react["default"].createElement(Warning, null, /*#__PURE__*/_react["default"].createElement("span", {
    className: "icon tu-icon-tishi"
  }), msg, canClose && /*#__PURE__*/_react["default"].createElement(_style.CloseBtn, {
    className: "tu-icon-canceled",
    onClick: function onClick() {
      instantce.removeNotice(key);
    }
  })));
}

function RenderError(msg, key) {
  var canClose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  var instantce = arguments.length > 3 ? arguments[3] : undefined;
  return /*#__PURE__*/_react["default"].createElement(_style.ToastWrapper, {
    className: "error-toast"
  }, /*#__PURE__*/_react["default"].createElement(Error, null, /*#__PURE__*/_react["default"].createElement("span", {
    className: "icon tu-icon-tishi"
  }), msg, canClose && /*#__PURE__*/_react["default"].createElement(_style.CloseBtn, {
    className: "tu-icon-canceled",
    onClick: function onClick() {
      instantce.removeNotice(key);
    }
  })));
}