diff --git a/src/components/ErrorContent.js b/src/components/ErrorContent.js index b060bcc0f6..b179f76953 100644 --- a/src/components/ErrorContent.js +++ b/src/components/ErrorContent.js @@ -1,13 +1,29 @@ import { Component } from 'react'; import PropTypes from 'prop-types'; +import { styled } from '@mui/material/styles'; import Accordion from '@mui/material/Accordion'; import AccordionSummary from '@mui/material/AccordionSummary'; import AccordionDetails from '@mui/material/AccordionDetails'; -import Typography from '@mui/material/Typography'; +import Stack from '@mui/material/Stack'; import Alert from '@mui/material/Alert'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import { PluginHook } from './PluginHook'; +const ErrorStackTrace = styled('pre', { name: 'ErrorContent', slot: 'stacktrace' })({ + overflowY: 'scroll', +}); + +const ErrorMetadata = styled('pre', { name: 'ErrorContent', slot: 'metadata' })({ + height: '100px', + overflowY: 'scroll', +}); + +const InlineAccordion = styled(Accordion, { name: 'ErrorContent', slot: 'accordion' })({ + backgroundColor: 'inherit', + color: 'inherit', + margin: 0, +}); + /** */ export class ErrorContent extends Component { /** */ @@ -22,38 +38,23 @@ export class ErrorContent extends Component { if (!showJsError) return null; return ( - <> - - {t('errorDialogTitle')} - - + + {t('errorDialogTitle')} {showJsError && ( - - }> - {t('jsError', { message: error.message, name: error.name })} - - - {t('jsStack', { stack: error.stack })} - {metadata && {JSON.stringify(metadata, null, 2)}} - - + + }> + {t('jsError', { message: error.message, name: error.name })} + + + + {t('jsStack', { stack: error.stack })} + {metadata && {JSON.stringify(metadata, null, 2)}} + + + )} - > + ); } }
{t('jsStack', { stack: error.stack })}
{JSON.stringify(metadata, null, 2)}