import React from 'react' ; import { EuiFormRow , EuiFieldText } from '@elastic/eui' ; interface TextInputOptionProps < ParamName extends string > { disabled ? : boolean ; helpText ? : React . ReactNode ; label ? : React . ReactNode ; paramName : ParamName ; value ? : string ; 'data-test-subj' ? : string ; setValue : ( paramName : ParamName , value : string ) => void ; } function TextInputOption < ParamName extends string > ( { 'data-test-subj' : dataTestSubj , disabled , helpText , label , paramName , value = '' , setValue , } ) { return ( < EuiFormRow helpText = { helpText } label = { label } fullWidth compressed > < EuiFieldText compressed fullWidth data - test - subj = { dataTestSubj } disabled = { disabled } value = { value } onChange = { ( ev ) => setValue ( paramName , ev . target . value ) } /> < /EuiFormRow>); } export { TextInputOption } ;