import React from 'react'; import { AlertTriangle } from 'lucide-react'; interface Props { children: React.ReactNode } interface State { error: Error | null } /** * Keeps one bad archive item from blanking the whole app. * * Post data is derived from filenames and arbitrary archive JSON, so a single * malformed record used to be able to throw during render and take the entire * tree down with it. */ export class ErrorBoundary extends React.Component { constructor(props: Props) { super(props); this.state = { error: null }; } static getDerivedStateFromError(error: Error): State { return { error }; } componentDidCatch(error: Error, info: React.ErrorInfo) { console.error('[ErrorBoundary] Render failed:', error, info.componentStack); } render() { if (!this.state.error) return this.props.children; return (

Something went wrong

This archive could not be rendered. Reloading usually clears it; if it persists, clear the cached copy from the archive explorer.

            {this.state.error.message}
          
); } }