"use strict";

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

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.QuizzesSpinner = 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 _Heading = _interopRequireDefault(require("@instructure/ui-elements/lib/components/Heading"));

var _PresentationContent = _interopRequireDefault(require("@instructure/ui-a11y/lib/components/PresentationContent"));

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

var _lib = _interopRequireDefault(require("@instructure/ui-themeable/lib"));

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

var _theme = _interopRequireDefault(require("./theme"));

var _dec, _class, _class2, _temp;

var styles = {
  componentId: 'eRkCs',
  template: function template(theme) {
    return "\n\n.eRkCs_gasz{align-items:center;display:inline-flex;flex:1 1 auto;height:100%;justify-content:center;min-height:500px;width:100%}\n\n:root .eRkCs_gasz,_:-ms-fullscreen{height:10rem}\n\n.eRkCs_bZBM .eRkCs_qrQc{flex:1 1 auto}\n\n.eRkCs_fBqo{font-size:".concat(theme.mainTextFontSize || 'inherit', "}");
  },
  'wrapper': 'eRkCs_gasz',
  'left': 'eRkCs_bZBM',
  'right': 'eRkCs_qrQc',
  'mainText': 'eRkCs_fBqo'
};
var QuizzesSpinner = (_dec = (0, _lib.default)(_theme.default, styles), _dec(_class = (_temp = _class2 =
/*#__PURE__*/
function (_Component) {
  (0, _inherits2.default)(QuizzesSpinner, _Component);

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

  (0, _createClass2.default)(QuizzesSpinner, [{
    key: "mainText",
    value: function mainText() {
      return this.props.mainText || "Ladataan...";
    }
  }, {
    key: "render",
    value: function render() {
      return _react.default.createElement("div", {
        className: styles.wrapper
      }, _react.default.createElement("div", {
        className: styles.left
      }, _react.default.createElement(_Spinner.default, {
        title: this.mainText(),
        size: "large"
      })), _react.default.createElement("div", {
        className: styles.right
      }, _react.default.createElement(_PresentationContent.default, null, _react.default.createElement(_Heading.default, {
        level: "h2",
        as: "h1"
      }, _react.default.createElement("div", {
        className: styles.mainText
      }, this.mainText())))));
    }
  }]);
  QuizzesSpinner.displayName = "QuizzesSpinner";
  return QuizzesSpinner;
}(_react.Component), _class2.propTypes = {
  mainText: _propTypes.default.string
}, _class2.defaultProps = {
  mainText: null
}, _temp)) || _class);
exports.QuizzesSpinner = QuizzesSpinner;
var _default = QuizzesSpinner;
exports.default = _default;