"use client";
import React, { useContext, useEffect, useRef, } from "react";
const EditContext = React.createContext(undefined);
export const EditContextProvider = EditContext.Provider;
export const useEditContext = () => useContext(EditContext);
export function useEditContextRef() {
    const contextValue = useEditContext();
    const contextRef = useRef(contextValue);
    useEffect(() => {
        contextRef.current = contextValue;
    }, [contextValue]);
    return contextRef;
}
const FieldsEditContext = React.createContext(undefined);
export const useFieldsEditContext = () => useContext(FieldsEditContext);
export const FieldsEditContextProvider = FieldsEditContext.Provider;
// Convenience ref hook mirroring useEditContextRef
export function useFieldsEditContextRef() {
    const contextValue = useFieldsEditContext();
    const contextRef = useRef(contextValue);
    useEffect(() => {
        contextRef.current = contextValue;
    }, [contextValue]);
    return contextRef;
}
const OperationsContext = React.createContext(undefined);
export const useOperationsContext = () => useContext(OperationsContext);
export const OperationsContextProvider = OperationsContext.Provider;
//# sourceMappingURL=editContext.js.map