@astarte-platform/react-bootstrap
Version:
React Bootstrap theme, fields and widgets for react-jsonschema-form, powered by react-bootstrap, this is a package from a fork of official project
18 lines • 809 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { errorId } from '@rjsf/utils';
import ListGroup from 'react-bootstrap/ListGroup';
/** The `FieldErrorTemplate` component renders the errors local to the particular field
*
* @param props - The `FieldErrorProps` for the errors being rendered
*/
export default function FieldErrorTemplate(props) {
const { errors = [], idSchema } = props;
if (errors.length === 0) {
return null;
}
const id = errorId(idSchema);
return (_jsx(ListGroup, { as: 'ul', id: id, children: errors.map((error, i) => {
return (_jsx(ListGroup.Item, { as: 'li', className: 'border-0 m-0 p-0', children: _jsx("small", { className: 'm-0 text-danger', children: error }) }, i));
}) }));
}
//# sourceMappingURL=FieldErrorTemplate.js.map