diff --git a/app/(gestionatl)/ui/forms-fields/errorComponent.tsx b/app/(gestionatl)/ui/forms-fields/errorComponent.tsx new file mode 100644 index 0000000..0a40aee --- /dev/null +++ b/app/(gestionatl)/ui/forms-fields/errorComponent.tsx @@ -0,0 +1,14 @@ +import React from 'react'; +import { FieldError, FieldErrorsImpl, Merge } from 'react-hook-form'; // Importa FieldErrorsImpl + +type ErrorMessageProps = { + error?: FieldError | Merge> | null; +}; + +const ErrorMessage: React.FC = ({ error }) => { + if (!error || typeof error.message !== 'string') return null; + + return {error.message}; +}; + +export default ErrorMessage; \ No newline at end of file