"use strict";
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 __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var lodash_1 = __importDefault(require("lodash"));
var classnames_1 = __importDefault(require("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_1.default('header-icon', (_a = {},
            _a[this.props.imageClass] = !lodash_1.default.isEmpty(this.props.imageClass),
            _a));
        return (react_1.default.createElement("div", { "data-test-automation-id": "headerIcon", className: className }, this.props.children));
    };
    HeaderIcon.propTypes = {
        imageClass: prop_types_1.default.string,
        children: function (props, propName, componentName) {
            var children = props[propName];
            var count = react_1.default.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_1.default.Component));
exports.HeaderIcon = HeaderIcon;
//# sourceMappingURL=HeaderIcon.js.map