@react-ui-org/react-ui
Version:
React UI is a themeable UI library for React apps.
40 lines (33 loc) • 844 B
JSX
import PropTypes from 'prop-types';
import React from 'react';
import { transferProps } from '../../helpers/transferProps';
import { withGlobalProps } from '../../providers/globalProps';
import { isChildrenEmpty } from '../../helpers/isChildrenEmpty/isChildrenEmpty';
import styles from './Card.module.scss';
export const CardFooter = ({
children,
...restProps
}) => {
if (isChildrenEmpty(children)) {
return null;
}
return (
<div
{...transferProps(restProps)}
className={styles.footer}
>
{children}
</div>
);
};
CardFooter.defaultProps = {
children: null,
};
CardFooter.propTypes = {
/**
* Card actions, usually buttons.
*/
children: PropTypes.node,
};
export const CardFooterWithGlobalProps = withGlobalProps(CardFooter, 'CardFooter');
export default CardFooterWithGlobalProps;