import { AlertTriangle, RefreshCw } from "lucide-react"; import { Component, type ErrorInfo, type ReactNode } from "react"; import { Button, Card } from "./primitives"; interface State { failed: boolean; } export class ErrorBoundary extends Component<{ children: ReactNode }, State> { state: State = { failed: false }; static getDerivedStateFromError(): State { return { failed: true }; } componentDidCatch(_error: Error, _info: ErrorInfo): void { // 管理端禁止记录可能包含用户或运营数据的渲染上下文。 } render() { if (!this.state.failed) return this.props.children; return (

页面暂时无法显示

页面渲染时出现异常。请重新加载,未提交的操作不会自动执行。

); } }