import React from 'react'; import './ErrorBoundary.css'; 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('ErrorBoundary caught an error:', error, errorInfo); } render() { if (this.state.hasError) { return (

Something went wrong.

We've encountered an unexpected error. Our team has been notified.

{typeof window !== 'undefined' && window.location.hostname === 'localhost' && (
{this.state.error?.toString()}
)}
); } return this.props.children; } } export default ErrorBoundary;