import React from "react"; class ErrorBoundary extends React.Component { constructor(props) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error) { return { hasError: true, error }; } componentDidCatch(error, errorInfo) { console.error("Error caught by boundary:", error, errorInfo); } render() { if (this.state.hasError) { return (

Something went wrong

The application encountered an error. Please refresh the page or contact support if the problem persists.

{process.env.NODE_ENV === "development" && this.state.error && (
Error Details (Development Only)
                    {this.state.error.toString()}
                    {this.state.error.stack}
                  
)}
); } return this.props.children; } } export default ErrorBoundary;