import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; import { ExportProvider } from './contexts/ExportContext'; import './index.css'; /** * Error Boundary for graceful error handling. */ class ErrorBoundary extends React.Component< { children: React.ReactNode }, { hasError: boolean; error?: Error } > { constructor(props: { children: React.ReactNode }) { super(props); this.state = { hasError: false }; } static getDerivedStateFromError(error: Error) { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: React.ErrorInfo) { console.error('GetMD Error:', error, errorInfo); } render() { if (this.state.hasError) { const { i18n } = window.summixGetmdData || {}; return (
{this.state.error?.message || (i18n?.errorDesc || "GetMD couldn't load. This is usually temporary.")}