"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 __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
var classnames = require("classnames");
var PropTypes = require("prop-types");
var React = require("react");
var Button_1 = require("../Button/Button");
var FlexBox_1 = require("../flex/FlexBox");
var FlexItem_1 = require("../flex/FlexItem");
require("./EditableInfoPanel.less");
var propTypes = {
    children: PropTypes.node.isRequired,
    className: PropTypes.string,
    title: PropTypes.node,
    onClick: PropTypes.func.isRequired,
};
var cssClass = {
    CONTAINER: "EditableInfoPanel",
    HEADER: "EditableInfoPanel--header",
    CONTENT: "EditableInfoPanel--content",
};
var EditableInfoPanel = /** @class */ (function (_super) {
    __extends(EditableInfoPanel, _super);
    function EditableInfoPanel() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    EditableInfoPanel.prototype.render = function () {
        var _a = this.props, title = _a.title, children = _a.children, className = _a.className, onClick = _a.onClick;
        return (React.createElement("div", { className: classnames(cssClass.CONTAINER, className) },
            React.createElement(FlexBox_1.default, { className: cssClass.HEADER },
                title,
                React.createElement(FlexItem_1.default, { grow: true }),
                React.createElement(FlexItem_1.default, null,
                    React.createElement(Button_1.Button, { value: "Edit", size: "small", onClick: onClick }))),
            React.createElement("div", { className: cssClass.CONTENT }, children)));
    };
    EditableInfoPanel.propTypes = propTypes;
    return EditableInfoPanel;
}(React.PureComponent));
exports.default = EditableInfoPanel;
