import React from "react"; class ErrorBoundary extends React.Component { constructor(props) { super(props); this.state = { hasError: false, message: "" }; } static getDerivedStateFromError(error) { return { hasError: true, message: error?.message || "Неизвестная ошибка." }; } componentDidCatch(error, info) { // eslint-disable-next-line no-console console.error("UI error boundary:", error, info); } handleReload = () => { window.location.reload(); }; render() { if (this.state.hasError) { return (

Интерфейс временно недоступен

{this.state.message}

); } return this.props.children; } } export default ErrorBoundary;