import { useState } from 'react'; import { useDebugCallGraph } from '../../api/queries/debug'; import { CallGraphCanvas } from '../../graph/components/CallGraphCanvas'; export function CallGraphPage() { const [selectedNode, setSelectedNode] = useState(null); const { data, isLoading, error } = useDebugCallGraph('project'); if (isLoading) return
Loading call graph...
; if (error) return (
Failed to load call graph. Have you run a scan?
); if (!data) return null; const selectedInfo = data.nodes.find((n) => n.id === selectedNode); return (
Project scope {data.nodes.length} functions, {data.edges.length} edges {data.sccs.length > 0 && `, ${data.sccs.length} recursive SCCs`} {data.unresolved_count > 0 && `, ${data.unresolved_count} unresolved`}
{selectedInfo && (

{selectedInfo.name}

Language {selectedInfo.lang}
Namespace {selectedInfo.namespace}
{selectedInfo.arity != null && (
Arity {selectedInfo.arity}
)}
)}
); }