import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2022-2025 GoodData Corporation
import { useIntl } from "react-intl";
import { Bubble } from "../../Bubble/Bubble.js";
import { BubbleHoverTrigger } from "../../Bubble/BubbleHoverTrigger.js";
import { Button } from "../../Button/Button.js";
import { Hyperlink } from "../../Hyperlink/Hyperlink.js";
import { LoadingSpinner } from "../../LoadingSpinner/LoadingSpinner.js";
import { Footer } from "../Footer.js";
import { FooterButtons } from "../FooterButtons.js";
/**
 * @internal
 */
export function StylingEditorDialogFooter({ link, disableSubmit = false, showProgressIndicator = false, errorMessage, onSubmit, onCancel, onHelpClick = () => { }, }) {
    const intl = useIntl();
    return (_jsxs(Footer, { children: [
            _jsx(Hyperlink, { text: link.text, href: link.url, onClick: () => onHelpClick(), iconClass: "gd-icon-circle-question" }), _jsxs(FooterButtons, { children: [showProgressIndicator ? (_jsx(LoadingSpinner, { className: "gd-loading-equalizer-spinner small s-gd-styling-editor-spinner" })) : null, _jsx(Button, { className: "gd-button-secondary s-dialog-cancel-button", value: intl.formatMessage({ id: "cancel" }), onClick: () => onCancel?.() }), _jsxs(BubbleHoverTrigger, { className: "gd-button", showDelay: 0, hideDelay: 0, children: [
                            _jsx(Button, { className: "gd-button-action s-dialog-submit-button", value: intl.formatMessage({ id: "save" }), onClick: () => onSubmit?.(), disabled: disableSubmit }), errorMessage && disableSubmit ? (_jsx(Bubble, { className: "bubble-negative", alignPoints: [{ align: "tc br" }], children: errorMessage })) : null] })
                ] })
        ] }));
}
