import { Card, Text, makeStyles, shorthands, tokens } from '@fluentui/react-components'; import type { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils'; import { TranslatableString } from '@rjsf/utils'; const useStyles = makeStyles({ errorCard: { backgroundColor: tokens.colorStatusDangerBackground1, marginBottom: tokens.spacingVerticalL, '&::after': { ...shorthands.borderColor(tokens.colorStatusDangerBorder1), }, }, errorTitle: { marginTop: 0, marginBottom: 0, }, }); /** 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, }: ErrorListProps) { const { translateString } = registry; const classes = useStyles(); return ( {translateString(TranslatableString.ErrorsLabel)}
    {errors.map((error, i: number) => ( // oxlint-disable-next-line react/no-array-index-key
  • {error.stack}
  • ))}
); }