import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2023-2025 GoodData Corporation
import { useIntl } from "react-intl";
import { messages } from "@gooddata/sdk-ui";
import { Button } from "@gooddata/sdk-ui-kit";
import { useAttributeHierarchyDialog } from "./AttributeHierarchyDialogProvider.js";
export function AddAttributeAction() {
    const { formatMessage } = useIntl();
    const { onAddEmptyAttribute, attributes } = useAttributeHierarchyDialog();
    const handleAddAttribute = () => {
        onAddEmptyAttribute(attributes.length - 1);
    };
    const addAttributeText = formatMessage(messages["hierarchyAddAttribute"]);
    return (_jsx("div", { className: "attribute-hierarchy-add-attribute-action s-attribute-hierarchy-add-attribute-action", children: _jsx(Button, { className: "gd-button-link gd-icon-plus", value: addAttributeText, onClick: handleAddAttribute }) }));
}
//# sourceMappingURL=AddAttributeAction.js.map