import React, { useContext } from "react";
import * as styles from "./styles";
const RootElementContext = React.createContext({});
const useRootElement = () => useContext(RootElementContext);
const RootElementContextProvider = ({ isExpanded, isScoresLoading, isMarkersLoading, activeScore, activeScoreData, markersData, onSelectScore, onToggleIsExpanded, children, }) => {
    const handleOnSidebarClick = () => {
        if (isExpanded) {
            return;
        }
        onToggleIsExpanded();
    };
    return (React.createElement(RootElementContext.Provider, { value: {
            isExpanded,
            isScoresLoading,
            isMarkersLoading,
            activeScore,
            activeScoreData,
            markersData,
            onToggleIsExpanded,
            onSelectScore,
        } },
        React.createElement("div", { className: styles.container, "data-is-expanded": isExpanded, "data-testid": "sidebar", onClick: handleOnSidebarClick }, children)));
};
export { useRootElement, RootElementContextProvider };
//# sourceMappingURL=context.js.map