"use strict";

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

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

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 _lib = _interopRequireDefault(require("@instructure/ui-themeable/lib"));

var _Overlay = _interopRequireDefault(require("../../../../../../common/components/shared/overlay/Overlay"));

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

var _dec, _class, _class2, _temp;

var styles = {
  componentId: 'bFiTq',
  template: function template(theme) {
    return "\n\n.Show__styles__titleShowWrapper {\n  position: relative;\n  width: 100%;\n  height: 5rem;\n\n  border-bottom: ".concat(theme.titleShowWrapperBottomBorder || 'inherit', ";\n  box-sizing: border-box;\n\n  padding-left: ").concat(theme.titleShowWrapperLeftPadding || 'inherit', ";\n\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n}\n\n.Show__styles__titleShowText {\n  font-size: ").concat(theme.titleShowTextFontSize || 'inherit', ";\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n");
  },
  'titleShowWrapper': 'Show__styles__titleShowWrapper',
  'titleShowText': 'Show__styles__titleShowText'
};
var QuizTitleShow = ( // ====================================
// this component shows the quiz title
// has events that allow for toggling
// editing and hover which shows an
// overlay
// ====================================
_dec = (0, _lib.default)(_theme.default, styles), _dec(_class = (_temp = _class2 =
/*#__PURE__*/
function (_Component) {
  (0, _inherits2.default)(QuizTitleShow, _Component);

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

  (0, _createClass2.default)(QuizTitleShow, [{
    key: "render",
    value: function render() {
      return _react.default.createElement(_Overlay.default, {
        wrapperClassName: styles.titleShowWrapper,
        onClick: this.props.switchOnEditing,
        tabIndex: "-1"
      }, _react.default.createElement("span", {
        className: styles.titleShowText
      }, this.props.defaultTitle));
    }
  }]);
  QuizTitleShow.displayName = "QuizTitleShow";
  return QuizTitleShow;
}(_react.Component), _class2.propTypes = {
  defaultTitle: _propTypes.default.string.isRequired,
  switchOnEditing: _propTypes.default.func.isRequired
}, _temp)) || _class);
exports.default = QuizTitleShow;