import { classNames } from '@/lib/components/classNames'; import type { ReactNode } from 'react'; import styles from './FormField.module.css'; interface FormFieldProps { id: string; label: string; required?: boolean; optionalLabel?: string | undefined; supportingText?: string | undefined; error?: string | undefined; children: ReactNode; className?: string | undefined; } export function FormField({ id, label, required = false, optionalLabel, supportingText, error, children, className, }: FormFieldProps) { return (
{children} {supportingText ? (

{supportingText}

) : null} {error ? (

{error}

) : null}
); } export function Fieldset({ legend, children, className, }: { legend: string; children: ReactNode; className?: string | undefined; }) { return (
{legend} {children}
); }