| 1 |
import styles from '@patternfly/react-styles/css/components/DescriptionList/description-list'; |
| 2 |
import { css } from '@patternfly/react-styles'; |
| 3 |
|
| 4 |
export interface DescriptionListTermProps extends React.HTMLProps<HTMLElement> { |
| 5 |
/** Anything that can be rendered inside of list term */ |
| 6 |
children: React.ReactNode; |
| 7 |
/** Icon that is rendered inside of list term to the left side of the children */ |
| 8 |
icon?: React.ReactNode; |
| 9 |
/** Additional classes added to the DescriptionListTerm */ |
| 10 |
className?: string; |
| 11 |
} |
| 12 |
|
| 13 |
export const DescriptionListTerm: React.FunctionComponent<DescriptionListTermProps> = ({ |
| 14 |
children, |
| 15 |
className, |
| 16 |
icon, |
| 17 |
...props |
| 18 |
}: DescriptionListTermProps) => ( |
| 19 |
<dt className={css(styles.descriptionListTerm, className)} {...props}> |
| 20 |
{icon ? <span className={css(styles.descriptionListTermIcon)}>{icon}</span> : null} |
| 21 |
<span className={css(styles.descriptionListText)}>{children}</span> |
| 22 |
</dt> |
| 23 |
); |
| 24 |
DescriptionListTerm.displayName = 'DescriptionListTerm'; |