import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2023-2026 GoodData Corporation
import { FormattedMessage, useIntl } from "react-intl";
import { messages } from "@gooddata/sdk-ui";
import { Button } from "@gooddata/sdk-ui-kit";
import { useDashboardSelector } from "../../../../../model/react/DashboardStoreProvider.js";
import { useDashboardUserInteraction } from "../../../../../model/react/useDashboardUserInteraction.js";
import { selectCanManageAttributeHierarchy } from "../../../../../model/store/permissions/permissionsSelectors.js";
// TODO: the link will be hidden until the documentation is ready
//  the if condition should be removed then after the documentation is ready
const EMPTY_HIERARCHY_INFO_DOCUMENTATION_LINK = "";
export function EmptyAttributeHierarchyInfo({ onOpenAttributeHierarchyDialog, }) {
    const { formatMessage } = useIntl();
    const canManageAttributeHierarchy = useDashboardSelector(selectCanManageAttributeHierarchy);
    const userInteraction = useDashboardUserInteraction();
    const handleOpenAttributeHierarchyDialog = () => {
        userInteraction.attributeHierarchiesInteraction("attributeHierarchyDrillDownCreateClicked");
        onOpenAttributeHierarchyDialog();
    };
    const addAttributeHierarchyText = formatMessage(messages["createHierarchy"]);
    return (_jsx(_Fragment, { children: _jsxs("div", { className: "empty-attribute-hierarchy-info s-empty-attribute-hierarchy-info", children: [
                _jsxs("div", { className: "empty-attribute-hierarchy-info-content s-empty-attribute-hierarchy-info-content", children: [
                        _jsx(FormattedMessage, { id: messages["emptyHierarchyInfo"].id, tagName: "span" }), EMPTY_HIERARCHY_INFO_DOCUMENTATION_LINK ? (_jsx("a", { href: EMPTY_HIERARCHY_INFO_DOCUMENTATION_LINK, className: "gd-button-link-dimmed", target: "_blank", rel: "noreferrer", children: _jsx(FormattedMessage, { id: messages["drillConfigLearnMore"].id }) })) : null] }), canManageAttributeHierarchy ? (_jsx(Button, { className: "gd-button-link gd-icon-plus gd-button-small add-attribute-hierarchy-button s-add-attribute-hierarchy-button", value: addAttributeHierarchyText, onClick: handleOpenAttributeHierarchyDialog })) : null] }) }));
}
