import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2007-2025 GoodData Corporation
import { useState } from "react";
import { FormattedMessage, useIntl } from "react-intl";
import { Checkbox, Typography } from "@gooddata/sdk-ui-kit";
export function InsightTitleConfig({ hideTitle, widget, setVisualPropsConfigurationTitle, isHidingOfWidgetTitleEnabled, }) {
    const intl = useIntl();
    const [widgetTitleState, setWidgetTitleState] = useState(hideTitle);
    const handleHideTitleChange = (isChecked) => {
        setWidgetTitleState(isChecked);
        setVisualPropsConfigurationTitle(widget, isChecked);
    };
    return (_jsx(_Fragment, { children: isHidingOfWidgetTitleEnabled ? (_jsxs("div", { className: "configuration-category s-hide-title-configuration", children: [
                _jsx(Typography, { tagName: "h3", className: "s-viz-title-headline", children: _jsx(FormattedMessage, { id: "configurationPanel.visualprops.sectionTitle" }) }), _jsx(Checkbox, { onChange: handleHideTitleChange, value: widgetTitleState, text: intl.formatMessage({ id: "configurationPanel.visualprops.hideTitle" }), labelSize: "small" })
            ] })) : null }));
}
//# sourceMappingURL=InsightTitleConfig.js.map