"use strict";

var __assign = void 0 && (void 0).__assign || function () {
  __assign = Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];

      for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
    }

    return t;
  };

  return __assign.apply(this, arguments);
};

var __rest = void 0 && (void 0).__rest || function (s, e) {
  var t = {};

  for (var p in s) {
    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  }

  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  }
  return t;
};

var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
  return mod && mod.__esModule ? mod : {
    "default": mod
  };
};

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.EmotionMemo = void 0;

var jsx_runtime_1 = require("react/jsx-runtime");

var react_1 = __importDefault(require("react"));

var classnames_1 = __importDefault(require("classnames"));

var icon_1 = __importDefault(require("../icon"));

var Dialog_1 = __importDefault(require("./Dialog"));

require("./style/emotion.css");

var prefixCls = 'dmc-dialog-emotion';

var Emotion = function Emotion(props) {
  var _a;

  var emotion = props.emotion,
      className = props.className,
      title = props.title,
      description = props.description,
      extra = props.extra,
      restProps = __rest(props, ["emotion", "className", "title", "description", "extra"]);

  var cls = classnames_1["default"](prefixCls, (_a = {}, _a[prefixCls + "-no-icon"] = !emotion, _a), className);
  return jsx_runtime_1.jsxs(Dialog_1["default"], __assign({}, restProps, {
    centered: true,
    title: false,
    className: cls,
    maskClosable: false,
    closable: false
  }, {
    children: [!!emotion && jsx_runtime_1.jsx(icon_1["default"], {
      icon: emotion,
      className: prefixCls + "-icon " + prefixCls + "-" + emotion
    }, void 0), jsx_runtime_1.jsx("div", __assign({
      className: prefixCls + "-title"
    }, {
      children: title
    }), void 0), !!description && jsx_runtime_1.jsx("div", __assign({
      className: prefixCls + "-desc"
    }, {
      children: description
    }), void 0), !!extra && jsx_runtime_1.jsx("div", __assign({
      className: prefixCls + "-extra"
    }, {
      children: extra
    }), void 0)]
  }), void 0);
};

Emotion.displayName = 'Emotion';
exports["default"] = Emotion;
var EmotionMemo = react_1["default"].memo(Emotion);
exports.EmotionMemo = EmotionMemo;
EmotionMemo.displayName = 'EmotionMemo';

