/** * šŸ“ Input Component * Componente de input reutilizĆ”vel com validação */ import React from 'react'; interface InputProps extends React.InputHTMLAttributes { label?: string; error?: string; helperText?: string; required?: boolean; } const Input = React.forwardRef( ( { label, error, helperText, required = false, id, className = '', type = 'text', ...props }, ref, ) => { const inputId = id || `input-${Math.random()}`; return (
{label && ( )} {error &&

{error}

} {helperText && !error && (

{helperText}

)}
); }, ); Input.displayName = 'Input'; export default Input;