"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var _Button = _interopRequireDefault(require("@instructure/ui-buttons/lib/components/Button"));

var _CloseButton = _interopRequireDefault(require("@instructure/ui-buttons/lib/components/CloseButton"));

var _Heading = _interopRequireDefault(require("@instructure/ui-elements/lib/components/Heading"));

var _Modal = _interopRequireWildcard(require("@instructure/ui-overlays/lib/components/Modal"));

var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/lib/format-message"));

var _Body = _interopRequireDefault(require("../Body"));

var AddContentModal =
/*#__PURE__*/
function (_Component) {
  (0, _inherits2.default)(AddContentModal, _Component);

  function AddContentModal() {
    (0, _classCallCheck2.default)(this, AddContentModal);
    return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(AddContentModal).apply(this, arguments));
  }

  (0, _createClass2.default)(AddContentModal, [{
    key: "cancelButton",
    value: function cancelButton() {
      return _react.default.createElement(_Button.default, {
        onClick: this.props.closeModal
      }, "\u0625\u0644\u063A\u0627\u0621");
    }
  }, {
    key: "renderContent",
    value: function renderContent() {
      return _react.default.createElement(_Body.default, {
        allowStimulusCreation: this.props.allowStimulusCreation,
        onOpenBankTray: this.props.closeModal,
        onAddItem: this.props.closeModal,
        parentEntryId: this.props.parentEntryId,
        position: this.props.position,
        quizId: this.props.quizId,
        showHeaderText: false,
        stimulusId: this.props.stimulusId
      });
    }
  }, {
    key: "render",
    value: function render() {
      return _react.default.createElement("div", null, _react.default.createElement(_Modal.default, {
        open: this.props.modalOpen,
        onDismiss: this.props.closeModal,
        size: "large",
        label: "\u0625\u0636\u0627\u0641\u0629 \u0627\u0644\u0645\u062D\u062A\u0648\u0649"
      }, _react.default.createElement(_Modal.ModalHeader, null, _react.default.createElement(_Heading.default, {
        level: "reset",
        as: "h2"
      }, "\u0625\u062F\u062E\u0627\u0644 \u0645\u062D\u062A\u0648\u0649"), _react.default.createElement(_CloseButton.default, {
        onClick: this.props.closeModal,
        placement: "end",
        offset: "medium",
        variant: "icon"
      })), _react.default.createElement(_Modal.ModalBody, null, this.renderContent()), _react.default.createElement(_Modal.ModalFooter, null, this.cancelButton())));
    }
  }]);
  AddContentModal.displayName = "AddContentModal";
  return AddContentModal;
}(_react.Component);

exports.default = AddContentModal;
AddContentModal.propTypes = {
  allowStimulusCreation: _propTypes.default.bool.isRequired,
  closeModal: _propTypes.default.func.isRequired,
  modalOpen: _propTypes.default.bool.isRequired,
  parentEntryId: _propTypes.default.string,
  position: _propTypes.default.number.isRequired,
  quizId: _propTypes.default.string.isRequired,
  stimulusId: _propTypes.default.string
};