import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';
import classnames from 'classnames';
export var HeaderIcon =
/*#__PURE__*/
function (_React$Component) {
  _inheritsLoose(HeaderIcon, _React$Component);

  function HeaderIcon() {
    return _React$Component.apply(this, arguments) || this;
  }

  var _proto = HeaderIcon.prototype;

  _proto.render = function render() {
    var _classnames;

    var className = classnames('header-icon', (_classnames = {}, _classnames[this.props.imageClass] = !_.isEmpty(this.props.imageClass), _classnames));
    return React.createElement("div", {
      "data-test-automation-id": "headerIcon",
      className: className
    }, this.props.children);
  };

  return HeaderIcon;
}(React.Component);

_defineProperty(HeaderIcon, "propTypes", {
  imageClass: PropTypes.string,
  children: function children(props, propName, componentName) {
    var children = props[propName];
    var count = React.Children.count(children);

    if (count > 0 && (count !== 1 || children.type.name !== 'Icon')) {
      return new Error("Only a Icon component is allowed in the body of the " + componentName + ".");
    }
  }
});

_defineProperty(HeaderIcon, "defaultProps", {
  imageClass: '',
  children: null
});