| 68 | const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue); |
| 69 | |
| 70 | function FormItem({ className, ...props }: React.ComponentProps<"div">) { |
| 71 | const id = React.useId(); |
| 72 | |
| 73 | return ( |
| 74 | <FormItemContext.Provider value={{ id }}> |
| 75 | <div data-slot="form-item" className={cn("grid gap-2", className)} {...props} /> |
| 76 | </FormItemContext.Provider> |
| 77 | ); |
| 78 | } |
| 79 | |
| 80 | function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) { |
| 81 | const { error, formItemId } = useFormField(); |