import clsx from "clsx"; import React from "react"; interface Props extends React.InputHTMLAttributes { name: string; label?: string; attributes?: { [key: string]: string | number | string[] }; helpText?: string | React.ReactNode; icon?: React.ReactNode; disabled?: boolean; right?: React.ReactNode; handleFocusChange?: (focused: boolean) => void; } const Input = (props: Props) => { return (
{props.label && ( )}
{props.helpText && (

{props.helpText}

)}
props.handleFocusChange && props.handleFocusChange(true)} onBlur={() => props.handleFocusChange && props.handleFocusChange(false)} {...(props.helpText ? { "aria-describedby": `${props.name}-description` } : {})} {...props.attributes} /> {props.right}
); }; export default Input;