MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / MermaidErrorBoundary

Class MermaidErrorBoundary

web/src/components/agent/agent-dependency-tree.tsx:30–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30class 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
60interface AgentDependencyTreeProps {
61 publisherId: string

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected