MCPcopy Index your code
hub / github.com/code-with-antonio/nodebase / FormMessage

Function FormMessage

src/components/ui/form.tsx:138–156  ·  view source on GitHub ↗
({ className, ...props }: React.ComponentProps<"p">)

Source from the content-addressed store, hash-verified

136}
137
138function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
139 const { error, formMessageId } = useFormField()
140 const body = error ? String(error?.message ?? "") : props.children
141
142 if (!body) {
143 return null
144 }
145
146 return (
147 <p
148 data-slot="form-message"
149 id={formMessageId}
150 className={cn("text-destructive text-sm", className)}
151 {...props}
152 >
153 {body}
154 </p>
155 )
156}
157
158export {
159 useFormField,

Callers

nothing calls this directly

Calls 2

cnFunction · 0.90
useFormFieldFunction · 0.85

Tested by

no test coverage detected