UNPKG

@react-ui-org/react-ui

Version:

React UI is a themeable UI library for React apps.

40 lines (33 loc) 855 B
import PropTypes from 'prop-types'; import React from 'react'; import { withGlobalProps } from '../../providers/globalProps'; import { transferProps } from '../../helpers/transferProps'; import { isChildrenEmpty } from '../../helpers/isChildrenEmpty/isChildrenEmpty'; import styles from './ModalContent.module.scss'; export const ModalContent = ({ children, ...restProps }) => { if (isChildrenEmpty(children)) { return null; } return ( <div {...transferProps(restProps)} className={styles.root} > {children} </div> ); }; ModalContent.defaultProps = { children: null, }; ModalContent.propTypes = { /** * Content of the modal. */ children: PropTypes.node, }; export const ModalContentWithGlobalProps = withGlobalProps(ModalContent, 'ModalContent'); export default ModalContentWithGlobalProps;