import * as React from 'react'; import { useFormField } from './hooks/useFormField/useFormField'; import { ctw } from '../../../utils/ctw/ctw'; export const FormMessage = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes >(({ className, children, ...props }, ref) => { const { error, formMessageId } = useFormField(); const body = error ? String(error?.message) : children; if (!body) { return null; } return (

{body}

); }); FormMessage.displayName = 'FormMessage';