"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PopupPanel = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const rebass_1 = require("rebass");
const join_1 = tslib_1.__importDefault(require("../../../../components/utils/join"));
const ButtonInfo_1 = require("../../Buttons/ButtonInfo");
const Noop = () => React.createElement(React.Fragment, null);
const PopupPanel = (props) => {
    const baseClassName = 'ab-Adaptable-Popup__Panel';
    return (React.createElement(rebass_1.Flex, { flexDirection: "column", flex: "1 1 0", className: (0, join_1.default)(props.className, baseClassName) },
        React.createElement("div", { className: `${baseClassName}__Header` },
            React.createElement(rebass_1.Flex, { alignItems: "center" },
                React.createElement(rebass_1.Box, { marginRight: 0, "data-name": "space-before" }),
                React.createElement("div", { className: `${baseClassName}__Header__Title` }, props.headerText),
                React.createElement(rebass_1.Box, { marginRight: 2, "data-name": "space-after" }),
                props.infoLink != null && !props.infoLinkDisabled && (React.createElement(ButtonInfo_1.ButtonInfo, { tone: "none", variant: "text", iconSize: 24, onClick: () => window.open(props.infoLink, '_blank' // <- opens the link in a new tab or window.
                    ) }))),
            React.createElement(rebass_1.Box, { style: { flex: 1 } }),
            props.button),
        React.createElement(rebass_1.Box, { className: `${baseClassName}__Body`, width: "100%", height: "100%", flex: 1 }, props.children)));
};
exports.PopupPanel = PopupPanel;
