import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import cx from "classnames";
import { Bubble, BubbleHoverTrigger, Button } from "@gooddata/sdk-ui-kit";
const ALIGN_POINTS = [{ align: "tc bc", offset: { x: 0, y: -5 } }];
function DashboardToolbarButtonBubbleWrapper({ tooltip, children, }) {
    if (!tooltip) {
        return _jsx("div", { className: "gd-toolbar-button-wrapper", children: children });
    }
    return (_jsxs(BubbleHoverTrigger, { className: "gd-toolbar-button-wrapper", children: [children, _jsx(Bubble, { alignPoints: ALIGN_POINTS, children: tooltip })
        ] }));
}
/**
 * @internal
 */
export function DefaultDashboardToolbarButton({ tooltip, disabled, icon, onClick, isActive, }) {
    return (_jsx(DashboardToolbarButtonBubbleWrapper, { tooltip: tooltip, children: _jsx(Button, { className: cx("gd-button-secondary", { [`gd-icon-${icon}`]: icon, "is-active": isActive }), disabled: disabled, onClick: onClick }) }));
}
