import { ForwardedRef, forwardRef } from 'react' import { InputMessageStyle } from './InputStyles' import { InputGroupStyle, InputGroupContentStyle } from './InputGroupStyles' import { InputGroupProps } from './types' function InputGroup( props: InputGroupProps, ref?: ForwardedRef ) { const { fullwidth = false, error, success, children, ...rest } = props const hasError = !!error const hasSuccess = !!success && !error return ( {children} {hasError && ( {error} )} {hasSuccess && ( {success} )} ) } export default forwardRef(InputGroup)