// handle the flow state and other things import React, { useCallback, useContext, useState } from 'react'; import FlowState from '../tree/FlowState'; interface IZenContext { handleFlowState?: () => void; } const ZenContext = React.createContext({}); export function ZenProvider({ children }: { children: React.ReactNode }) { const [flowState, setFlowState] = useState(false); const handleFlowState = useCallback(() => { setFlowState(true); }, [setFlowState]); const handleReconnect = useCallback(() => { setFlowState(false); }, [setFlowState]); if (flowState) { return ; } return {children}; } export default function useZen() { return useContext(ZenContext); }