| 28 | } |
| 29 | |
| 30 | class MermaidErrorBoundary extends React.Component< |
| 31 | { children: React.ReactNode }, |
| 32 | MermaidErrorBoundaryState |
| 33 | > { |
| 34 | constructor(props: { children: React.ReactNode }) { |
| 35 | super(props) |
| 36 | this.state = { hasError: false } |
| 37 | } |
| 38 | |
| 39 | static getDerivedStateFromError(): MermaidErrorBoundaryState { |
| 40 | return { hasError: true } |
| 41 | } |
| 42 | |
| 43 | componentDidCatch(error: Error, errorInfo: React.ErrorInfo) { |
| 44 | console.error('Mermaid diagram error:', error, errorInfo) |
| 45 | } |
| 46 | |
| 47 | render() { |
| 48 | if (this.state.hasError) { |
| 49 | return ( |
| 50 | <div className="flex items-center gap-2 text-sm text-muted-foreground py-4"> |
| 51 | <AlertCircle className="h-4 w-4" /> |
| 52 | <span>Unable to render diagram</span> |
| 53 | </div> |
| 54 | ) |
| 55 | } |
| 56 | return this.props.children |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | interface AgentDependencyTreeProps { |
| 61 | publisherId: string |
nothing calls this directly
no outgoing calls
no test coverage detected