import { InputHTMLAttributes, forwardRef } from 'react';
interface InputProps extends InputHTMLAttributes {
label?: string;
error?: string;
}
export const Input = forwardRef(
({ label, error, className = '', id, ...props }, ref) => {
const inputId = id || label?.toLowerCase().replace(/\s+/g, '-');
return (
{label && (
)}
{error &&
{error}
}
);
}
);
Input.displayName = 'Input';