Description.js 578 B

12345678910111213141516171819202122
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { Col } from 'antd';
  4. import styles from './index.less';
  5. import responsive from './responsive';
  6. const Description = ({ term, column, children, ...restProps }) => (
  7. <Col {...responsive[column]} {...restProps}>
  8. {term && <div className={styles.term}>{term}</div>}
  9. {children !== null && children !== undefined && <div className={styles.detail}>{children}</div>}
  10. </Col>
  11. );
  12. Description.defaultProps = {
  13. term: '',
  14. };
  15. Description.propTypes = {
  16. term: PropTypes.node,
  17. };
  18. export default Description;