import { Clipboard, RefreshCw, ServerCrash } from 'lucide-react'; import { Component, type ErrorInfo, type ReactNode } from 'react'; import log from 'electron-log/renderer'; import { useT } from '~renderer/i18n'; import PageBackground from './assets/background.png'; import TextButton from './components/styled/TextButton'; type State = { didCatch?: boolean; error?: Error; errorInfo?: ErrorInfo; }; type Props = { children: ReactNode; }; const ErrorFallback = ({ error, errorInfo }: { error?: Error; errorInfo?: ErrorInfo; }) => { const t = useT(); const title = t('misc.uncaughtError', { name: error?.name ?? '', message: error?.message ?? t('misc.unknownError') }); const detail = errorInfo?.componentStack?.slice(1); return (
{detail}