import { Component, type ReactNode, type ErrorInfo } from 'react'; import { RotateCcw, AlertOctagon, Trash2 } from 'lucide-react'; interface RootErrorBoundaryProps { children: ReactNode; } interface RootErrorBoundaryState { hasError: boolean; error: Error | null; } export default class RootErrorBoundary extends Component< RootErrorBoundaryProps, RootErrorBoundaryState > { constructor(props: RootErrorBoundaryProps) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error: Error): RootErrorBoundaryState { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: ErrorInfo) { console.error('[RootErrorBoundary] Fatal system error caught at OS root:', error, errorInfo); } handleReboot = () => { window.location.reload(); }; handleHardReset = () => { try { localStorage.clear(); sessionStorage.clear(); } catch (_) {} window.location.reload(); }; render() { if (this.state.hasError) { return (
{/* CRT scanline simulation */}
{/* Header */}

ALGOSPACED_RECOVERY_CONSOLE

STOP: 0x000000D1 • DESKTOP_THREAD_EXCEPTION

{/* Error Details */}
Fault Trace:
{this.state.error?.message || 'A fatal system exception was trapped by the OS kernel.'}

A recoverable exception occurred in the primary desktop shell. Your local data and progress records are safely preserved in storage.

{/* Action Bar */}
); } return this.props.children; } }