UNPKG

@teknim/rjsf-mantine

Version:

Mantine theme, fields and widgets for react-jsonschema-form

16 lines 825 B
import { jsx as _jsx } from "react/jsx-runtime"; import { errorId } from '@rjsf/utils'; import { Box, List } from '@mantine/core'; /** The `FieldErrorTemplate` component renders the errors local to the particular field * * @param props - The `FieldErrorProps` for the errors being rendered */ export default function FieldErrorTemplate({ errors, idSchema }) { if (!errors || !errors.length) { return null; } // In mantine, errors are handled directly in each component, so there is no need to render a separate error template. const id = errorId(idSchema); return (_jsx(Box, { id: id, c: 'red', display: 'none', children: _jsx(List, { children: errors.map((error, index) => (_jsx(List.Item, { children: error }, `field-error-${index}`))) }) })); } //# sourceMappingURL=FieldErrorTemplate.js.map