import { StrictMode, Component, ErrorInfo, ReactNode } from 'react'; import { createRoot } from 'react-dom/client'; import App from './App.tsx'; import './index.css'; import { StorageService } from './services/storageService'; // Initialize storage schema and default records try { StorageService.initialize(); } catch (e) { console.warn('Storage initial bootstrap warning:', e); } interface ErrorBoundaryProps { children: ReactNode; } interface ErrorBoundaryState { hasError: boolean; error: Error | null; } class ErrorBoundary extends Component { 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('Uncaught error in React tree:', error, errorInfo); } handleReset = () => { localStorage.clear(); sessionStorage.clear(); window.location.reload(); }; render() { if (this.state.hasError) { return (
!

Falha ao Renderizar Painel

Ocorreu um erro inesperado ao renderizar este componente. Você pode reiniciar os dados locais do aplicativo para restaurar o estado inicial padrão.

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