import { useT } from '../lib/i18n/I18nContext'; import { LATEST_APP_DOWNLOAD_URL } from '../utils/config'; import { openUrl } from '../utils/openUrl'; /** * ErrorFallbackScreen * * Full-screen recovery UI shown when the Sentry ErrorBoundary catches * a catastrophic React render error. Self-contained with zero dependencies * on Redux, Router, or any context provider. * * Errors caught by the boundary are auto-forwarded to Sentry by the * `Sentry.ErrorBoundary` wrapper in `App.tsx` (subject to user analytics * consent enforced in `analytics.ts::beforeSend`). */ interface ErrorFallbackScreenProps { error: unknown; componentStack?: string; onReset: () => void; } export default function ErrorFallbackScreen({ error, componentStack, onReset, }: ErrorFallbackScreenProps) { const { t } = useT(); const errorName = error instanceof Error ? error.name : 'Error'; const errorMessage = error instanceof Error ? error.message : String(error); return (
{/* Accent bar */}
{/* Icon */}
{/* Title */}

{t('app.errorFallback.heading')}

{t('app.errorFallback.subheading')}

{t('app.errorFallback.hint')}

{/* Error details */}

{errorName}

{errorMessage}

{componentStack && (
{t('app.errorFallback.componentStack')}
                  {componentStack}
                
)}
{/* Actions */}
); }