import { jsx as _jsx } from "react/jsx-runtime";
import { createContext, useContext, useMemo } from 'react';
const configContext = createContext(null);
export function ConfigContextProvider(props) {
    const contextValue = useMemo(() => ({ config: props.initialConfig }), [props.initialConfig]);
    return _jsx(configContext.Provider, { value: contextValue, children: props.children });
}
export function useConfig() {
    const context = useContext(configContext);
    if (!context) {
        throw new Error('useConfigContext must be used within a ConfigContextProvider');
    }
    return context.config;
}
//# sourceMappingURL=config-context.js.map