| 1 |
import styles from '@patternfly/react-styles/css/components/TextInputGroup/text-input-group'; |
| 2 |
import { css } from '@patternfly/react-styles'; |
| 3 |
|
| 4 |
export interface TextInputGroupIconProps extends React.HTMLProps<HTMLSpanElement> { |
| 5 |
/** Content rendered inside the text input group utilities div */ |
| 6 |
children?: React.ReactNode; |
| 7 |
/** Additional classes applied to the text input group utilities container */ |
| 8 |
className?: string; |
| 9 |
/** Flag indicating if the icon is a status icon and should inherit status styling. */ |
| 10 |
isStatus?: boolean; |
| 11 |
} |
| 12 |
|
| 13 |
export const TextInputGroupIcon: React.FunctionComponent<TextInputGroupIconProps> = ({ |
| 14 |
children, |
| 15 |
className, |
| 16 |
isStatus, |
| 17 |
...props |
| 18 |
}: TextInputGroupIconProps) => ( |
| 19 |
<span className={css(styles.textInputGroupIcon, isStatus && styles.modifiers.status, className)} {...props}> |
| 20 |
{children} |
| 21 |
</span> |
| 22 |
); |
| 23 |
|
| 24 |
TextInputGroupIcon.displayName = 'TextInputGroupIcon'; |