import type { ReactNode } from "react"; import { cn, fieldErrorClass, fieldHelpClass, fieldLabelClass, } from "@/lib/ui/variants"; interface FieldProps { label: string; children: ReactNode; htmlFor?: string; help?: ReactNode; error?: ReactNode; required?: boolean; className?: string; } export function Field({ label, children, htmlFor, help, error, required = false, className, }: FieldProps) { const labelText = required ? `${label} *` : label; return (
{error}
: null} {!error && help ?{help}
: null}