import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["icon", "onCloseClick", "children"];
import React from 'react';
import { IconCloseMediumOutline } from '@teamleader/ui-icons';
import Section from '../section';
import IconButton from '../iconButton';
import Icon from '../icon';
import theme from './theme.css';

var Header = function Header(_ref) {
  var icon = _ref.icon,
      onCloseClick = _ref.onCloseClick,
      children = _ref.children,
      rest = _objectWithoutProperties(_ref, _excluded);

  return /*#__PURE__*/React.createElement(Section, _extends({
    display: "flex",
    alignItems: "center",
    color: "neutral"
  }, rest), icon && /*#__PURE__*/React.createElement(Icon, {
    color: "teal",
    tint: "darkest",
    marginRight: 3
  }, icon), children, onCloseClick && /*#__PURE__*/React.createElement(IconButton, {
    icon: /*#__PURE__*/React.createElement(IconCloseMediumOutline, null),
    onClick: onCloseClick,
    marginVertical: -1,
    className: theme['close-icon']
  }));
};

Header.displayName = 'Header';
export default Header;