"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
var _provider = _interopRequireWildcard(require("../../atom/provider"));
var _buttonLinkIcon = _interopRequireDefault(require("../../atom/button-link-icon"));
var _reviewHeaderSteps = _interopRequireDefault(require("../../molecule/review-header-steps"));
var _style = _interopRequireDefault(require("./style.css"));
var _types = _interopRequireDefault(require("./types"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const ReviewHeader = (props, legacyContext) => {
  const {
    steps,
    mode,
    skillName,
    'aria-label': ariaLabel,
    onQuitClick,
    hiddenSteps
  } = props;
  const translate = (0, _provider.GetTranslateFromContext)(legacyContext);
  const skin = (0, _provider.GetSkinFromContext)(legacyContext);
  const closeButtonAriaLabel = translate('close_button_ariaLabel');
  const primarySkinColor = (0, _getOr.default)('#00B0FF', 'common.primary', skin);
  const buttonProps = {
    icon: 'close',
    'data-name': 'review-header-close-button',
    'aria-label': closeButtonAriaLabel,
    onClick: onQuitClick,
    size: 'responsive',
    className: _style.default.review
  };
  const stepsWrapper = (0, _classnames.default)(_style.default.stepsWrapper, hiddenSteps ? _style.default.stepsWrapperAnimation : null);
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.headerWrapper,
    "data-name": "review-header",
    "aria-label": ariaLabel
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.titlesWrapper
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.title,
    title: mode,
    "aria-label": mode,
    "data-name": "review-header-mode"
  }, mode), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.skillName,
    style: {
      color: primarySkinColor
    },
    title: skillName,
    "aria-label": skillName,
    "data-name": "review-header-skill-name"
  }, skillName)), /*#__PURE__*/_react.default.createElement("div", {
    className: stepsWrapper
  }, /*#__PURE__*/_react.default.createElement(_reviewHeaderSteps.default, {
    steps: steps,
    key: 'review-header-steps'
  })), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.iconButtonWrapper,
    "data-testid": "review-header-close-button-wrapper"
  }, /*#__PURE__*/_react.default.createElement(_buttonLinkIcon.default, buttonProps)));
};
ReviewHeader.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
ReviewHeader.contextTypes = {
  skin: _provider.default.childContextTypes.skin,
  translate: _provider.default.childContextTypes.translate
};
var _default = exports.default = ReviewHeader;
//# sourceMappingURL=index.js.map