import react, { useContext, useEffect, useState } from "react";
const ExecutionStatusContext = /*#__PURE__*/ react.createContext({
    getNodeExecutionState: ()=>void 0,
    getEdgeExecutionState: ()=>void 0
});
const useNodeExecutionState = (nodeId)=>{
    const context = useContext(ExecutionStatusContext);
    const [state, setState] = useState();
    useEffect(()=>{
        setState(context.getNodeExecutionState(nodeId));
    }, [
        nodeId,
        context
    ]);
    return state;
};
const useEdgeExecutionState = (edgeId, targetNodeId)=>{
    const context = useContext(ExecutionStatusContext);
    const [state, setState] = useState();
    useEffect(()=>{
        const executionState = context.getEdgeExecutionState(edgeId, targetNodeId);
        setState(executionState);
    }, [
        edgeId,
        targetNodeId,
        context
    ]);
    return state;
};
export { ExecutionStatusContext, useEdgeExecutionState, useNodeExecutionState };
