import { classNames } from '@/utils'; import React, { MouseEventHandler, useId } from 'react'; import ErrorMessage from './ErrorMessage'; import { SimpleInputProps } from './SimpleInput'; export interface TrailingInputProps extends SimpleInputProps { btnIcon?: any; btnLabel?: any; onBtnClick?: MouseEventHandler; helpText?: string; } const TrailingInput: React.FC = (props) => { const Icon = props.icon; const BtnIcon = props.btnIcon; const hasErrors = Boolean(props.errors && props.errors.length > 0); const generatedId = useId(); return ( <> {typeof props.label === 'string' ? ( ) : ( props.label )}
{props.icon && (
)}
{props.helpText &&

{props.helpText}

} ); }; export default TrailingInput;