import _defineProperty from "@babel/runtime/helpers/defineProperty";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import "core-js/modules/es.symbol.js";
import "core-js/modules/es.error.to-string.js";
import "core-js/modules/es.array.map.js";
import "core-js/modules/es.array.filter.js";
import "core-js/modules/es.array.for-each.js";
import "core-js/modules/es.array.push.js";
import "core-js/modules/es.date.to-string.js";
import "core-js/modules/es.object.define-properties.js";
import "core-js/modules/es.object.define-property.js";
import "core-js/modules/es.object.get-own-property-descriptor.js";
import "core-js/modules/es.object.get-own-property-descriptors.js";
import "core-js/modules/es.object.keys.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.regexp.to-string.js";
import "core-js/modules/esnext.iterator.constructor.js";
import "core-js/modules/esnext.iterator.filter.js";
import "core-js/modules/esnext.iterator.for-each.js";
import "core-js/modules/esnext.iterator.map.js";
import "core-js/modules/web.dom-collections.for-each.js";
import { FcrButton } from '../button';
import { BaseDialog } from '.';
import './class-dialog.css';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export var FcrClassDialog = function FcrClassDialog(props) {
  var visible = props.visible,
    onClose = props.onClose,
    title = props.title,
    content = props.content,
    maskClosable = props.maskClosable,
    imgUrl = props.imgUrl,
    width = props.width,
    actions = props.actions,
    cancelBtn = props.cancelBtn;
  return /*#__PURE__*/_jsx(BaseDialog, {
    closable: false,
    classNames: "fcr-class-dialog",
    width: width || 344,
    maskClosable: maskClosable,
    visible: visible,
    onClose: onClose,
    children: /*#__PURE__*/_jsxs("div", {
      className: "fcr-class-dialog-inner",
      children: [imgUrl && /*#__PURE__*/_jsx("div", {
        className: "fcr-class-dialog-img",
        children: /*#__PURE__*/_jsx("img", {
          src: imgUrl
        })
      }), /*#__PURE__*/_jsx("div", {
        className: "fcr-class-dialog-title",
        children: title
      }), /*#__PURE__*/_jsx("div", {
        className: "fcr-class-dialog-content",
        children: content
      }), /*#__PURE__*/_jsx("div", {
        className: "fcr-class-dialog-actions",
        children: actions === null || actions === void 0 ? void 0 : actions.map(function (btnProps, index) {
          return /*#__PURE__*/_jsx(FcrButton, _objectSpread(_objectSpread({
            size: "S",
            block: true
          }, btnProps), {}, {
            children: btnProps.text || 'Text'
          }), index.toString());
        })
      }), cancelBtn && /*#__PURE__*/_jsx("div", {
        className: "fcr-class-dialog-cancel",
        onClick: onClose,
        children: /*#__PURE__*/_jsx(FcrButton, {
          size: "S",
          block: true,
          children: "Cancel"
        })
      })]
    })
  });
};