Remove unused ErrorView from ds webapp

This commit is contained in:
John Colvin committed 2024-10-21 13:29:59 +00:00
1 parent 7f87644b10
commit 5cd558d402
2 files changed
-46

No files matched your search

@@ -1,4 +0,0 @@
p.error-text {
font-weight: bold;
color: var(--error-color);
}
@@ -1,42 +0,0 @@
import React from 'react';
import { Box, Typography, Collapse } from '@mui/material';
import { useTheme } from '@mui/material/styles';
import Alert from '@mui/material/Alert';
import AlertTitle from '@mui/material/AlertTitle';
const ErrorView = ({ error }) => {
const theme = useTheme();
const [open, setOpen] = React.useState(false);
if (!error) {
return null;
}
return (
<Box sx={{ margin: theme.spacing(2) }}>
<Alert severity="error" onClick={() => setOpen(!open)} sx={{ cursor: 'pointer' }}>
<AlertTitle>Error Code: {error.code}</AlertTitle>
{error.message}
</Alert>
<Collapse in={open}>
<Box
sx={{
backgroundColor: theme.palette.error.light,
color: theme.palette.error.contrastText,
padding: theme.spacing(2),
marginTop: theme.spacing(1),
borderRadius: theme.shape.borderRadius,
}}
>
<Typography variant="body1">{error.data.error_message}</Typography>
<Typography variant="subtitle1">Stack Trace:</Typography>
<Typography variant="body2" component="pre" sx={{ whiteSpace: 'pre-wrap' }}>
{error.data.stack_trace}
</Typography>
</Box>
</Collapse>
</Box>
);
};
export default ErrorView;