import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2024-2026 GoodData Corporation
import cx from "classnames";
import { FormattedMessage } from "react-intl";
import { IconColumnContainer, OverlayController, OverlayControllerProvider, UiLink, UiTooltip, bemFactory, useMediaQuery, } from "@gooddata/sdk-ui-kit";
import { useTheme } from "@gooddata/sdk-ui-theme-provider";
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
import { selectIsWhiteLabeled } from "../../../model/store/config/configSelectors.js";
import { DASHBOARD_DIALOG_OVERS_Z_INDEX } from "../../constants/zIndex.js";
const overlayController = OverlayController.getInstance(DASHBOARD_DIALOG_OVERS_Z_INDEX);
const tooltipBem = bemFactory("gd-container-tooltip");
export function AddDashboardLayoutWidgetButton() {
    const isMobileDevice = useMediaQuery("mobileDevice");
    const isWhiteLabeled = useDashboardSelector(selectIsWhiteLabeled);
    const theme = useTheme();
    return (_jsxs("div", { className: "add-item-placeholder add-panel-item s-add-dashboard-layout", children: [
            _jsx(IconColumnContainer, { color: theme?.palette?.complementary?.c6 ?? "#94a1ad" }), _jsxs("div", { className: "add-panel-item__text", children: [
                    _jsx(FormattedMessage, { id: "addPanel.dashboardLayout" }), _jsx(OverlayControllerProvider, { overlayController: overlayController, children: _jsx(UiTooltip, { arrowPlacement: "left", content: _jsxs("div", { className: tooltipBem.b(), children: [
                                    _jsx("div", { className: tooltipBem.e("image") }), _jsx("div", { className: tooltipBem.e("text"), children: _jsx(FormattedMessage, { id: "addPanel.dashboardLayout.tooltip" }) }), isWhiteLabeled ? null : (_jsx("div", { className: tooltipBem.e("actions"), children: _jsx(UiLink, { variant: "inverse", rel: "noreferrer noopener", target: "_blank", href: "https://www.gooddata.com/docs/cloud/create-dashboards/dashboard-layout/#column-container", children: _jsx(FormattedMessage, { id: "addPanel.dashboardLayout.tooltip.learnMore" }) }) }))] }), anchor: _jsx("div", { className: cx("s-description-trigger gd-add-item-placeholder-help-trigger", {
                                    "is-mobile": isMobileDevice,
                                }), children: _jsx("div", { className: "gd-icon-circle-question" }) }), optimalPlacement: true, triggerBy: ["hover"] }) })
                ] })
        ] }));
}
//# sourceMappingURL=AddDashboardLayoutWidgetButton.js.map