"use client"; import * as React from "react"; import { cn } from "../../utils/cn.js"; import { Label } from "./label.js"; import { useFieldContext, useFormContext, } from "../../hooks/use_resource_form.js"; import { X } from "lucide-react"; const FormField = ({ className, ...props }: React.ComponentProps<"div">) => { return
; }; const FormLabel = ({ className, children, required, ...props }: React.ComponentProps<"div"> & { required?: boolean }) => { const form = useFormContext(); const { state, name } = useFieldContext(); return (
{state.meta.isDirty && ( form.resetField(name)} /> )}
); }; const FormDescription = ({ className, ...props }: React.ComponentProps<"p">) => { const { name } = useFieldContext(); return (

); }; const FormMessage = ({ className, children, ...props }: React.ComponentProps<"p">) => { const { state, name } = useFieldContext(); // TODO: Error message const body = state.meta.errors ? String("An error with this field") : children; if (!body) { return null; } return (

{body}

); }; export { FormField, FormLabel, FormDescription, FormMessage };