@rjsf/antd
Version:
Ant Design theme, fields and widgets for react-jsonschema-form
14 lines • 983 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Alert, List, Space } from 'antd';
import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';
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;
const renderErrors = () => (_jsx(List, { className: 'list-group', size: 'small', children: errors.map((error, index) => (_jsx(List.Item, { children: _jsxs(Space, { children: [_jsx(ExclamationCircleOutlined, {}), error.stack] }) }, index))) }));
return (_jsx(Alert, { className: 'panel panel-danger errors', description: renderErrors(), message: translateString(TranslatableString.ErrorsLabel), type: 'error' }));
}
//# sourceMappingURL=index.js.map