import { jsx as _jsx } from "react/jsx-runtime";
import { useDashboardSelector } from "../../../../../model/react/DashboardStoreProvider.js";
import { selectInsightsMap } from "../../../../../model/store/insights/insightsSelectors.js";
import { VisualizationListItem } from "./VisualizationListItem.js";
export const VisualizationsList = ({ visualizations, activeVisualizationId, onVisualizationDeleted, onVisualizationSelect, onVisualizationPositionChange, }) => {
    const insightsMap = useDashboardSelector(selectInsightsMap);
    const shouldRenderActions = visualizations.length > 1;
    return visualizations.map((visualization, index) => {
        const insight = insightsMap.get(visualization.insight);
        const isActive = visualization.identifier === activeVisualizationId;
        const isLast = index === visualizations.length - 1;
        const isFirst = index === 0;
        return (_jsx(VisualizationListItem, { visualization: visualization, insight: insight, isActive: isActive, isLast: isLast, isFirst: isFirst, shouldRenderActions: shouldRenderActions, onVisualizationSelect: onVisualizationSelect, onVisualizationDeleted: onVisualizationDeleted, onVisualizationPositionChange: onVisualizationPositionChange }, visualization.identifier));
    });
};
//# sourceMappingURL=VisualizationsList.js.map