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 * as React from 'react';
import classnames from 'classnames';
import { FlexBlock } from './flexBlock';
import { Icon } from './Icon';
var ChipsItem = /** @class */ (function (_super) {
    __extends(ChipsItem, _super);
    function ChipsItem() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    ChipsItem.prototype.renderCloseButton = function () {
        var onClose = this.props.onClose;
        if (!onClose) {
            return null;
        }
        return (React.createElement("button", { "data-test-automation-id": "closeButton", className: "rc-chips-item__close-button", onClick: onClose },
            React.createElement(Icon, { name: "close" })));
    };
    ChipsItem.prototype.render = function () {
        var _a = this.props, children = _a.children, testAutomationId = _a.testAutomationId, onClose = _a.onClose;
        var className = classnames('rc-chips-item', {
            'rc-chips-item--interactive': !!onClose
        });
        return (React.createElement("div", { className: className, "data-test-automation-id": testAutomationId },
            React.createElement(FlexBlock, { shouldUnwrapChildren: true, gutterWidth: 0, align: FlexBlock.CENTER },
                React.createElement("div", { className: "rc-chips-item__content", "data-test-automation-id": "content" }, children),
                this.renderCloseButton())));
    };
    ChipsItem.defaultProps = {
        testAutomationId: 'chipsItem'
    };
    return ChipsItem;
}(React.PureComponent));
export { ChipsItem };
//# sourceMappingURL=ChipsItem.js.map