import { type InputHTMLAttributes, forwardRef } from "react"
import { cn } from "@/lib/utils"
interface FormInputProps extends InputHTMLAttributes {
label?: string
error?: string
hint?: string
}
export const FormInput = forwardRef(
({ label, error, hint, className, id, ...props }, ref) => {
const inputId = id || label?.toLowerCase().replace(/\s+/g, "-")
return (
{label && (
)}
{hint && !error && (
{hint}
)}
{error &&
{error}
}
)
}
)
FormInput.displayName = "FormInput"