UNPKG

@rjsf/mui

Version:

Material UI 5 theme, fields and widgets for react-jsonschema-form

21 lines 1.34 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import ErrorIcon from '@mui/icons-material/Error'; import Box from '@mui/material/Box/index.js'; import List from '@mui/material/List/index.js'; import ListItem from '@mui/material/ListItem/index.js'; import ListItemIcon from '@mui/material/ListItemIcon/index.js'; import ListItemText from '@mui/material/ListItemText/index.js'; import Paper from '@mui/material/Paper/index.js'; import Typography from '@mui/material/Typography/index.js'; import { TranslatableString } from '@rjsf/utils'; /** The `ErrorList` component is the template that renders the all the errors associated with the fields in the `Form` * * @param props - The `ErrorListProps` for this component */ export default function ErrorList({ errors, registry, }) { const { translateString } = registry; return (_jsx(Paper, { elevation: 2, children: _jsxs(Box, { mb: 2, p: 2, children: [_jsx(Typography, { variant: 'h6', children: translateString(TranslatableString.ErrorsLabel) }), _jsx(List, { dense: true, children: errors.map((error, i) => { return (_jsxs(ListItem, { children: [_jsx(ListItemIcon, { children: _jsx(ErrorIcon, { color: 'error' }) }), _jsx(ListItemText, { primary: error.stack })] }, i)); }) })] }) })); } //# sourceMappingURL=ErrorList.js.map