import React, { InputHTMLAttributes, forwardRef } from 'react'; import { cn } from '@/utils/helpers'; interface InputProps extends InputHTMLAttributes { label?: string; error?: string; helperText?: string; } export const Input = forwardRef( ({ label, error, helperText, className, ...props }, ref) => { return ( {label && ( {label} {props.required && *} )} {error && ( {error} )} {!error && helperText && ( {helperText} )} ); } ); Input.displayName = 'Input';
{error}
{helperText}