import { errorId, FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@snups/rjsf-utils'; import { Message } from 'primereact/message'; /** The `FieldErrorTemplate` component renders the errors local to the particular field * * @param props - The `FieldErrorProps` for the errors being rendered */ export default function FieldErrorTemplate< T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any, >({ errors, idSchema }: FieldErrorProps) { if (errors && errors.length > 0) { const id = errorId(idSchema); const content = errors.map((error, i: number) => { return
{error}
; }); return ( ); } return null; }