| 1 |
import styles from '@patternfly/react-styles/css/components/Card/card'; |
| 2 |
import { css } from '@patternfly/react-styles'; |
| 3 |
|
| 4 |
import type { JSX } from 'react'; |
| 5 |
|
| 6 |
export interface CardFooterProps extends React.HTMLProps<HTMLDivElement> { |
| 7 |
/** Content rendered inside the Card Footer */ |
| 8 |
children?: React.ReactNode; |
| 9 |
/** Additional classes added to the Footer */ |
| 10 |
className?: string; |
| 11 |
/** Sets the base component to render. defaults to div */ |
| 12 |
component?: keyof JSX.IntrinsicElements; |
| 13 |
} |
| 14 |
|
| 15 |
export const CardFooter: React.FunctionComponent<CardFooterProps> = ({ |
| 16 |
children, |
| 17 |
className, |
| 18 |
component = 'div', |
| 19 |
...props |
| 20 |
}: CardFooterProps) => { |
| 21 |
const Component = component as any; |
| 22 |
return ( |
| 23 |
<Component className={css(styles.cardFooter, className)} {...props}> |
| 24 |
{children} |
| 25 |
</Component> |
| 26 |
); |
| 27 |
}; |
| 28 |
CardFooter.displayName = 'CardFooter'; |