'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.QuizzesSpinner = undefined;

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _dec, _class, _class2, _temp;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

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

var _Heading2 = _interopRequireDefault(_Heading);

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

var _PresentationContent2 = _interopRequireDefault(_PresentationContent);

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

var _Spinner2 = _interopRequireDefault(_Spinner);

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

var _lib2 = _interopRequireDefault(_lib);

var _formatMessage = require('../../../format-message');

var _formatMessage2 = _interopRequireDefault(_formatMessage);

var _theme = require('./theme');

var _theme2 = _interopRequireDefault(_theme);

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

var styles = {
  template: function template(theme) {
    return '/*  imported from styles.css  */\n\n._1zbOdihBKXJzapg0MxoalX {\n  width: 100%;\n  height: 100%;\n  min-height: 500px;\n  display: inline-flex;\n  flex: 1 1 auto;\n  align-items: center;\n  justify-content: center;\n}\n\n/* min-height doesn\'t work with flex on IE11 */\n/* stylelint-disable */\n_:-ms-fullscreen, :root ._1zbOdihBKXJzapg0MxoalX {\n  height: 10rem;\n}\n/* stylelint-enable */\n\n._1dnCDPEZDq_iBkOVtUKSsc ._3rMrXLgNzZ5I3cLOXflmhW {\n  flex: 1 1 auto;\n}\n\n._3N9WOkADzDGjDWJLO1rz5L {\n  font-size: ' + theme.mainTextFontSize + ';\n}\n';
  },
  'wrapper': '_1zbOdihBKXJzapg0MxoalX',
  'left': '_1dnCDPEZDq_iBkOVtUKSsc',
  'right': '_3rMrXLgNzZ5I3cLOXflmhW',
  'mainText': '_3N9WOkADzDGjDWJLO1rz5L'
};
var QuizzesSpinner = exports.QuizzesSpinner = (_dec = (0, _lib2.default)(_theme2.default, styles), _dec(_class = (_temp = _class2 = function (_Component) {
  (0, _inherits3.default)(QuizzesSpinner, _Component);

  function QuizzesSpinner() {
    (0, _classCallCheck3.default)(this, QuizzesSpinner);
    return (0, _possibleConstructorReturn3.default)(this, (QuizzesSpinner.__proto__ || Object.getPrototypeOf(QuizzesSpinner)).apply(this, arguments));
  }

  (0, _createClass3.default)(QuizzesSpinner, [{
    key: 'mainText',
    value: function mainText() {
      return this.props.mainText || (0, _formatMessage2.default)('Loading...');
    }
  }, {
    key: 'render',
    value: function render() {
      return _react2.default.createElement(
        'div',
        { className: styles.wrapper },
        _react2.default.createElement(
          'div',
          { className: styles.left },
          _react2.default.createElement(_Spinner2.default, { title: this.mainText(), size: 'large' })
        ),
        _react2.default.createElement(
          'div',
          { className: styles.right },
          _react2.default.createElement(
            _PresentationContent2.default,
            null,
            _react2.default.createElement(
              _Heading2.default,
              { level: 'h2', as: 'h1' },
              _react2.default.createElement(
                'div',
                { className: styles.mainText },
                this.mainText()
              )
            )
          )
        )
      );
    }
  }]);
  QuizzesSpinner.displayName = 'QuizzesSpinner'
  ;
  return QuizzesSpinner;
}(_react.Component), _class2.propTypes = {
  mainText: _propTypes2.default.string
}, _class2.defaultProps = { mainText: null }, _temp)) || _class);
exports.default = QuizzesSpinner;