import React from "react";
import { renderSingleMenu } from "./node-view/render-single-menu";
export const MenuSidebar = React.memo(({ currentChart, menuNames, menus, reportEvent, }) => {
    const handleScrollToId = (event) => {
        event.preventDefault();
        const chartNodeId = event.currentTarget.getAttribute("href");
        if (chartNodeId) {
            const node = document.getElementById(chartNodeId.replace("#", ""));
            if (node) {
                node.scrollIntoView();
            }
        }
    };
    return (React.createElement("div", { className: "node-view__sidebar", role: "complementary" },
        React.createElement("ul", { className: "nav dashboard-sidenav" }, menuNames.map(renderSingleMenu({
            currentChart,
            handleScrollToId,
            menus,
            reportEvent,
        })))));
});
//# sourceMappingURL=menu-sidebar.js.map