import { useRef, useState } from 'react'; import { BehaviorTreeExecutor } from '../../utils/BehaviorTreeExecutor'; export function useEditorState() { const canvasRef = useRef(null); const stopExecutionRef = useRef<(() => void) | null>(null); const executorRef = useRef(null); const [selectedConnection, setSelectedConnection] = useState<{from: string; to: string} | null>(null); return { canvasRef, stopExecutionRef, executorRef, selectedConnection, setSelectedConnection }; }