| 1 |
import { useState } from 'react'; |
| 2 |
import { Form, FormGroup, FormHelperText, TextInput, HelperText, HelperTextItem } from '@patternfly/react-core'; |
| 3 |
|
| 4 |
export const HelperTextStaticText: React.FunctionComponent = () => { |
| 5 |
const [value, setValue] = useState(''); |
| 6 |
|
| 7 |
const handleInputChange = (_event, inputValue: string) => { |
| 8 |
setValue(inputValue); |
| 9 |
}; |
| 10 |
|
| 11 |
return ( |
| 12 |
<Form> |
| 13 |
<FormGroup label="Middle Name" fieldId="login-input-helper-text1"> |
| 14 |
<TextInput |
| 15 |
type="text" |
| 16 |
id="login-input-helper-text1" |
| 17 |
name="login-input-helper-text1" |
| 18 |
onChange={handleInputChange} |
| 19 |
aria-describedby="helper-text1" |
| 20 |
value={value} |
| 21 |
/> |
| 22 |
<FormHelperText> |
| 23 |
<HelperText id="helper-text1"> |
| 24 |
<HelperTextItem>Enter your middle name or your middle initial</HelperTextItem> |
| 25 |
</HelperText> |
| 26 |
</FormHelperText> |
| 27 |
</FormGroup> |
| 28 |
</Form> |
| 29 |
); |
| 30 |
}; |