import React, { Component } from 'react'; import type { ReactNode } from 'react'; import { AlertCircle } from 'lucide-react'; import { classNames } from '~/utils/classNames'; interface Props { children: ReactNode; fallback?: ReactNode; onError?: (error: Error, errorInfo: React.ErrorInfo) => void; } interface State { hasError: boolean; error?: Error; } export default class ErrorBoundary extends Component { constructor(props: Props) { super(props); this.state = { hasError: false }; } static getDerivedStateFromError(error: Error): State { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: React.ErrorInfo) { console.error('Local Providers Error Boundary caught an error:', error, errorInfo); this.props.onError?.(error, errorInfo); } render() { if (this.state.hasError) { if (this.props.fallback) { return this.props.fallback; } return (

Something went wrong

There was an error loading the local providers section.

{process.env.NODE_ENV === 'development' && this.state.error && (
Error Details
                {this.state.error.stack}
              
)}
); } return this.props.children; } }