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 classnames from "classnames";
import * as PropTypes from "prop-types";
import * as React from "react";
import { Button } from "../Button/Button";
import FlexBox from "../flex/FlexBox";
import FlexItem from "../flex/FlexItem";
import "./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, { className: cssClass.HEADER },
                title,
                React.createElement(FlexItem, { grow: true }),
                React.createElement(FlexItem, null,
                    React.createElement(Button, { value: "Edit", size: "small", onClick: onClick }))),
            React.createElement("div", { className: cssClass.CONTENT }, children)));
    };
    EditableInfoPanel.propTypes = propTypes;
    return EditableInfoPanel;
}(React.PureComponent));
export default EditableInfoPanel;
