var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import React from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';
import classnames from 'classnames';
var HeaderIcon = /** @class */ (function (_super) {
    __extends(HeaderIcon, _super);
    function HeaderIcon() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    HeaderIcon.prototype.render = function () {
        var _a;
        var className = classnames('header-icon', (_a = {},
            _a[this.props.imageClass] = !_.isEmpty(this.props.imageClass),
            _a));
        return (React.createElement("div", { "data-test-automation-id": "headerIcon", className: className }, this.props.children));
    };
    HeaderIcon.propTypes = {
        imageClass: PropTypes.string,
        children: function (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 + ".");
            }
        }
    };
    HeaderIcon.defaultProps = {
        imageClass: '',
        children: null
    };
    return HeaderIcon;
}(React.Component));
export { HeaderIcon };
//# sourceMappingURL=HeaderIcon.js.map