import { jsx as _jsx } from "react/jsx-runtime";
import { useState, createContext, useContext } from 'react';
export const SyncedCursorChartsContext = createContext(null);
export const useCursorX = () => {
    const contextValue = useContext(SyncedCursorChartsContext);
    if (contextValue === null) {
        console.error("Can't use useCursorX() outside SyncedCursorCharts");
    }
    return contextValue;
};
export function SyncedCursorCharts({ children }) {
    const [cursorX, setCursorX] = useState(0);
    return (_jsx(SyncedCursorChartsContext.Provider, { value: {
            cursorX,
            setCursorX,
        }, children: children }));
}
