import { Component, type ErrorInfo, type ReactNode } from "react"; interface Props { children: ReactNode; } interface State { hasError: boolean; } export class AppErrorBoundary extends Component { state: State = { hasError: false }; static getDerivedStateFromError(): State { return { hasError: true }; } componentDidCatch(error: Error, info: ErrorInfo): void { console.error("UI crash captured by AppErrorBoundary", error, info); } render(): ReactNode { if (this.state.hasError) { return (

Something went wrong

The app hit an unexpected UI error. Reload to continue.

); } return this.props.children; } }