"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

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

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

var _react = _interopRequireDefault(require("react"));

var _uiIcons = require("@teamleader/ui-icons");

var _section = _interopRequireDefault(require("../section"));

var _iconButton = _interopRequireDefault(require("../iconButton"));

var _icon = _interopRequireDefault(require("../icon"));

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

var _excluded = ["icon", "onCloseClick", "children"];

var Header = function Header(_ref) {
  var icon = _ref.icon,
      onCloseClick = _ref.onCloseClick,
      children = _ref.children,
      rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  return /*#__PURE__*/_react.default.createElement(_section.default, (0, _extends2.default)({
    display: "flex",
    alignItems: "center",
    color: "neutral"
  }, rest), icon && /*#__PURE__*/_react.default.createElement(_icon.default, {
    color: "teal",
    tint: "darkest",
    marginRight: 3
  }, icon), children, onCloseClick && /*#__PURE__*/_react.default.createElement(_iconButton.default, {
    icon: /*#__PURE__*/_react.default.createElement(_uiIcons.IconCloseMediumOutline, null),
    onClick: onCloseClick,
    marginVertical: -1,
    className: _theme.default['close-icon']
  }));
};

Header.displayName = 'Header';
var _default = Header;
exports.default = _default;