import { Component, ErrorInfo, ReactNode } from "react"; interface Props { children?: ReactNode; } interface State { hasError: boolean; error: Error | null; errorInfo: ErrorInfo | null; } export class ErrorBoundary extends Component { public state: State = { hasError: false, error: null, errorInfo: null }; public static getDerivedStateFromError(error: Error): State { return { hasError: true, error, errorInfo: null }; } public componentDidCatch(error: Error, errorInfo: ErrorInfo) { console.error("Uncaught error:", error, errorInfo); this.setState({ errorInfo }); } public render() { if (this.state.hasError) { return (

Firelink could not display this window.

The error was written to Logs. Reload the interface to reconnect to the running download service.

); } return this.props.children; } }