"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DashboardToolbar = DashboardToolbar;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const SimpleButton_1 = tslib_1.__importDefault(require("../SimpleButton"));
const join_1 = tslib_1.__importDefault(require("../utils/join"));
const Flex_1 = require("../Flex");
function DashboardToolbar(props) {
    return (React.createElement("div", { className: (0, join_1.default)('ab-Dashboard__toolbar', props.className) },
        React.createElement("div", { className: "ab-Dashboard__toolbar-content" }, props.children),
        React.createElement(Flex_1.Flex, { className: "ab-Dashboard__toolbar-title twa:items-center twa:justify-center twa:px-2 twa:pb-1 twa:opacity-70", flexDirection: "row" },
            React.createElement("span", { className: "twa:text-2" }, props.title),
            props.showConfigure && (React.createElement(SimpleButton_1.default, { "aria-label": `Configure ${props.title}`, icon: "spanner", variant: "text", tone: "none", "data-name": "configure", iconSize: 16, className: "twa:ml-1", tooltip: props.tooltip || `Configure ${props.title}`, onClick: () => props.onConfigure() })),
            props.showClose && (React.createElement(SimpleButton_1.default, { "aria-label": `Close ${props.title}`, style: { alignSelf: 'flex-end' }, disabled: props.accessLevel == 'ReadOnly', "data-name": "close", icon: "close", variant: "text", tone: "none", iconSize: 16, className: "twa:ml-1", tooltip: props.tooltip || `Close ${props.title} Toolbar`, onClick: () => props.onClose?.() })))));
}
