import React from "react"; import { BrokenImage } from "@mui/icons-material"; import { Tooltip } from "@mui/material"; export default class ImageErrorBoundary extends React.Component<{ src: string; children: JSX.Element; }> { state = { hasError: false }; static getDerivedStateFromError() { return { hasError: true }; } render() { const { src } = this.props; if (this.state.hasError) { return ( {src} } >
); } return this.props.children; } }