import React, {StrictMode, type ErrorInfo, type ReactNode} from 'react'; import {createRoot} from 'react-dom/client'; import App from './App.tsx'; import './index.css'; interface ErrorBoundaryProps { children: ReactNode; } interface ErrorBoundaryState { hasError: boolean; error: Error | null; } class ErrorBoundary extends React.Component { state: ErrorBoundaryState; props: ErrorBoundaryProps; constructor(props: ErrorBoundaryProps) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error: Error): ErrorBoundaryState { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: ErrorInfo) { console.error("ErrorBoundary caught an error", error, errorInfo); } render() { if (this.state.hasError) { return (

Application Error

An unexpected error occurred while rendering the application interface.

            {this.state.error?.stack || this.state.error?.message}
          
); } return this.props.children; } } createRoot(document.getElementById('root')!).render( , );