import { jsx as _jsx } from "react/jsx-runtime";
import { useDashboardSelector } from "../../../../model/react/DashboardStoreProvider.js";
import { selectInsightsMap } from "../../../../model/store/insights/insightsSelectors.js";
import { selectRenderMode } from "../../../../model/store/renderMode/renderModeSelectors.js";
import { DashboardInsightMenuBody } from "../../insightMenu/DefaultDashboardInsightMenu/DashboardInsightMenu/index.js";
import { useVisualizationSwitcherEditableInsightMenu } from "./useVisualizationSwitcherEditableInsightMenu.js";
export function VisualizationConfig({ widget, onVisualizationDeleted }) {
    const insights = useDashboardSelector(selectInsightsMap);
    const insight = insights.get(widget.insight);
    if (!insight) {
        return null;
    }
    return (_jsx(VisualizationConfigContent, { widget: widget, insight: insight, onVisualizationDeleted: onVisualizationDeleted }));
}
function VisualizationConfigContent({ widget, insight, onVisualizationDeleted, }) {
    const { menuItems } = useVisualizationSwitcherEditableInsightMenu(widget, insight, onVisualizationDeleted);
    const renderMode = useDashboardSelector(selectRenderMode);
    return (_jsx(DashboardInsightMenuBody, { widget: widget, insight: insight, items: menuItems, renderMode: renderMode, isOpen: true, onClose: () => { } }, widget.identifier));
}
//# sourceMappingURL=VisualizationConfig.js.map