"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;exports.__esModule = true;exports.MiniModalHeader = void 0;var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _react = _interopRequireWildcard(require("react"));


var _Modal = require("../Modal");
var _forwardRefAndName = require("../../lib/forwardRefAndName");
var _InfoCircleIcon64Regular = require("../../internal/icons2022/InfoCircleIcon/InfoCircleIcon64Regular");
var _ThemeContext = require("../../lib/theming/ThemeContext");
var _Emotion = require("../../lib/theming/Emotion");

var _MiniModal = require("./MiniModal.styles");
var _MiniModal2 = require("./MiniModal");var _excluded = ["icon", "children"];







/**
 * Обёртка над Modal.Header
 *
 * @visibleName MiniModal.Header
 */
var MiniModalHeader = exports.MiniModalHeader = (0, _forwardRefAndName.forwardRefAndName)(
  'MiniModalHeader',
  function (_ref, ref) {var _cx;var _ref$icon = _ref.icon,icon = _ref$icon === void 0 ? /*#__PURE__*/_react.default.createElement(_InfoCircleIcon64Regular.InfoCircleIcon64Regular, null) : _ref$icon,children = _ref.children,rest = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
    var theme = (0, _react.useContext)(_ThemeContext.ThemeContext);

    return /*#__PURE__*/(
      _react.default.createElement(_Modal.Modal.Header, rest, /*#__PURE__*/
      _react.default.createElement("div", { ref: ref },
      icon && /*#__PURE__*/
      _react.default.createElement("div", { "data-tid": _MiniModal2.MiniModalDataTids.icon, className: _MiniModal.styles.icon() },
      icon
      ),

      children && /*#__PURE__*/
      _react.default.createElement("div", {
        "data-tid": _MiniModal2.MiniModalDataTids.title,
        className: (0, _Emotion.cx)(_MiniModal.styles.title(), (_cx = {}, _cx[
        _MiniModal.styles.titleWithIcon(theme)] = !!icon, _cx)
        ) },

      children
      )

      )
      ));

  }
);