MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / FormMessage

Function FormMessage

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

Source from the content-addressed store, hash-verified

143}
144
145function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
146 const { error, formMessageId } = useFormField();
147 const body = error ? String(error?.message ?? "") : props.children;
148
149 if (!body) {
150 return null;
151 }
152
153 return (
154 <p
155 data-slot='form-message'
156 id={formMessageId}
157 className={cn("text-destructive text-sm", className)}
158 {...props}
159 >
160 {body}
161 </p>
162 );
163}
164
165export {
166 useFormField,

Callers

nothing calls this directly

Calls 2

cnFunction · 0.90
useFormFieldFunction · 0.85

Tested by

no test coverage detected