import React, { useMemo } from "react";
import getMenu from "./getMenu";
import { ChartsProvider } from "./charts";
import { MenuGroupIdsProvider, MenuGroupProvider } from "./menuGroup";
import { SubMenuByIdProvider } from "./subMenu";
import { ActiveMenuProvider } from "./active";
import { ListProvider } from "./list";
const Provider = ({ container, activeMenuGroupId, activeSubMenuId, chartIds, getChart, getChartAttributes, onAttributesChange, dashboardAttributes, hasKubernetes, children, }) => {
    const { menuGroupIds, menuGroupById, subMenuById, menuChartsAttributeById } = useMemo(() => getMenu(chartIds, getChart, { hasKubernetes }), [chartIds, getChart]);
    return (React.createElement(ChartsProvider, { container: container, menuChartsAttributeById: menuChartsAttributeById, getChartAttributes: getChartAttributes, onAttributesChange: onAttributesChange, getChart: getChart, dashboardAttributes: dashboardAttributes },
        React.createElement(MenuGroupIdsProvider, { ids: menuGroupIds },
            React.createElement(MenuGroupProvider, { menuGroupById: menuGroupById },
                React.createElement(SubMenuByIdProvider, { subMenuById: subMenuById },
                    React.createElement(ActiveMenuProvider, { menuGroupId: activeMenuGroupId, subMenuId: activeSubMenuId },
                        React.createElement(ListProvider, null, children)))))));
};
export default Provider;
//# sourceMappingURL=provider.js.map