"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames = _interopRequireDefault(require("classnames"));
var _novaIcons = require("@coorpacademy/nova-icons");
var _link = _interopRequireDefault(require("../../../../../atom/link"));
var _microlearning = _interopRequireDefault(require("./microlearning.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
const Content = ({
  onClick,
  title,
  mode
}, context) => {
  const content = /*#__PURE__*/_react.default.createElement("div", {
    "data-name": "contentTitle",
    className: (0, _classnames.default)(_microlearning.default.contentTitle, _microlearning.default.innerHTML)
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: title
    }
  });
  if (mode === 'scorm') return /*#__PURE__*/_react.default.createElement("div", {
    className: _microlearning.default.contentScorm
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _microlearning.default.backIcon
  }), content);
  return /*#__PURE__*/_react.default.createElement(_link.default, {
    onClick: onClick,
    className: _microlearning.default.content
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionNavigationArrowLeft, {
    className: _microlearning.default.backIcon
  }), content);
};
Content.propTypes = process.env.NODE_ENV !== "production" ? {
  onClick: _link.default.propTypes.onClick,
  title: _propTypes.default.node,
  mode: _propTypes.default.string
} : {};
const MicrolearningHeader = (props, context) => {
  const {
    content,
    mode
  } = props;
  return /*#__PURE__*/_react.default.createElement(Content, _extends({}, content, {
    mode: mode
  }));
};
MicrolearningHeader.propTypes = process.env.NODE_ENV !== "production" ? {
  content: _propTypes.default.shape({
    onClick: _link.default.propTypes.onClick,
    title: _propTypes.default.string.isRequired
  }),
  mode: _propTypes.default.string
} : {};
var _default = exports.default = MicrolearningHeader;
//# sourceMappingURL=microlearning.js.map