// src/components/ErrorBoundary.jsx import { Component } from 'react'; export default class ErrorBoundary extends Component { constructor(props) { super(props); this.state = { hasError: false, message: '' }; } static getDerivedStateFromError(err) { return { hasError: true, message: err?.message ?? String(err) }; } componentDidCatch(err, info) { console.error('ErrorBoundary caught:', err, info); } render() { if (this.state.hasError) { return (