{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "error-boundary",
  "title": "Error Boundary",
  "description": "Error boundary wrapper with neubrutalism-styled fallback UI. Used by math-curve components to catch runtime errors gracefully.",
  "registryDependencies": [
    "@boldkit/utils",
    "@boldkit/button",
    "@boldkit/card"
  ],
  "files": [
    {
      "path": "registry/default/components/ErrorBoundary.tsx",
      "content": "import { Component, type ReactNode } from 'react'\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'\nimport { AlertTriangle, RefreshCw, Home } from 'lucide-react'\n\ninterface Props {\n  children: ReactNode\n}\n\ninterface State {\n  hasError: boolean\n  error?: Error\n}\n\nexport class ErrorBoundary extends Component<Props, State> {\n  constructor(props: Props) {\n    super(props)\n    this.state = { hasError: false }\n  }\n\n  static getDerivedStateFromError(error: Error): State {\n    return { hasError: true, error }\n  }\n\n  componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n    // Log error to console in development\n    if (process.env.NODE_ENV === 'development') {\n      console.error('Error caught by boundary:', error, errorInfo)\n    }\n  }\n\n  handleReload = () => {\n    window.location.reload()\n  }\n\n  handleGoHome = () => {\n    window.location.href = '/'\n  }\n\n  render() {\n    if (this.state.hasError) {\n      return (\n        <div className=\"min-h-screen bg-background flex items-center justify-center p-4\">\n          <Card className=\"max-w-lg w-full\">\n            <CardHeader className=\"bg-destructive\">\n              <CardTitle className=\"flex items-center gap-3\">\n                <AlertTriangle className=\"h-6 w-6 stroke-[3]\" />\n                Something went wrong\n              </CardTitle>\n            </CardHeader>\n            <CardContent className=\"pt-6 space-y-4\">\n              <p className=\"text-muted-foreground\">\n                An unexpected error occurred. This has been logged and we'll look into it.\n              </p>\n              {process.env.NODE_ENV === 'development' && this.state.error && (\n                <pre className=\"bg-muted border-3 border-foreground p-4 text-sm overflow-x-auto\">\n                  <code>{this.state.error.message}</code>\n                </pre>\n              )}\n              <div className=\"flex gap-3\">\n                <Button onClick={this.handleReload} className=\"gap-2\">\n                  <RefreshCw className=\"h-4 w-4\" />\n                  Reload Page\n                </Button>\n                <Button variant=\"outline\" onClick={this.handleGoHome} className=\"gap-2\">\n                  <Home className=\"h-4 w-4\" />\n                  Go Home\n                </Button>\n              </div>\n            </CardContent>\n          </Card>\n        </div>\n      )\n    }\n\n    return this.props.children\n  }\n}\n",
      "type": "registry:component",
      "target": "components/ErrorBoundary.tsx"
    }
  ],
  "type": "registry:component"
}