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

Application Error

An error occurred while loading the application.

            {state.error?.message || String(state.error)}
          
); } return props.children; } } const rootElement = document.getElementById('root'); if (rootElement) { createRoot(rootElement).render( ); }