import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2022-2025 GoodData Corporation
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";
import { Header } from "../Header.js";
import { Separator } from "../Separator.js";
import { SettingWidget } from "../SettingWidget.js";
import { Title } from "../Title.js";
/**
 * This widget toggles one setting on/off.
 *
 * @internal
 */
export function SimpleSettingWidget({ title, currentSettingStatus, titleTooltip, helpLinkText, helpLinkUrl, actionButtonText, isLoading, onSubmit, onHelpLinkClick, }) {
    return (_jsxs(SettingWidget, { children: [
            _jsxs(Header, { children: [
                    _jsx(Title, { title: title, tooltip: titleTooltip }), isLoading ? (_jsx(LoadingSpinner, { className: "small gd-loading-equalizer-spinner" })) : (_jsx("span", { className: "gd-setting-widget-status-pill", children: currentSettingStatus }))] }), _jsx(Separator, {}), _jsxs(Footer, { children: [helpLinkText && helpLinkUrl ? (_jsx(Hyperlink, { text: helpLinkText, href: helpLinkUrl, iconClass: "gd-icon-circle-question", onClick: onHelpLinkClick })) : null, isLoading ? null : (_jsx(FooterButtons, { children: _jsx(Button, { className: "gd-button-action", onClick: onSubmit, disabled: isLoading, value: actionButtonText }) }))] })
        ] }));
}
