import { Component, type ReactNode } from "react"; export class SurfaceErrorBoundary extends Component< { children: ReactNode; fallback: ReactNode }, { failed: boolean } > { state = { failed: false }; static getDerivedStateFromError() { return { failed: true }; } render() { return this.state.failed ? this.props.fallback : this.props.children; } }