import { ReactNode } from 'react'; import { defaultLayoutConfig, type LayoutConfig } from '~/lib/layout-utils'; interface FormFieldProps { children: ReactNode; label?: string; error?: string; helperText?: string; required?: boolean; className?: string; config?: Partial; htmlFor?: string; } export function FormField({ children, label, error, helperText, required = false, className = '', config = {}, htmlFor, }: FormFieldProps) { const layoutConfig = { ...defaultLayoutConfig, ...config }; return (
{label && ( )} {children} {error && (

{error}

)} {helperText && !error && (

{helperText}

)}
); }