import React, { useEffect, useState } from 'react'; import StackTrace from 'stacktrace-js'; import styles from './ErrorBoundaryError.css'; interface ErrorBoundaryErrorProps { className: string; messageClassName: string; detailsClassName: string; message: string; error: Error; info: { componentStack: string; }; } function ErrorBoundaryError(props: ErrorBoundaryErrorProps) { const { className = styles.container, messageClassName = styles.message, detailsClassName = styles.details, message = 'There was an error loading this content', error, info, } = props; const [detailedError, setDetailedError] = useState(null); useEffect(() => { if (error) { StackTrace.fromError(error).then((de) => { setDetailedError(de); }); } else { setDetailedError(null); } }, [error, setDetailedError]); return (