Description.js 578 Bytes
Newer Older
1
import React from 'react';
ddcat1115's avatar
ddcat1115 committed
2
import PropTypes from 'prop-types';
3 4 5 6
import { Col } from 'antd';
import styles from './index.less';
import responsive from './responsive';

ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
7 8 9 10 11 12
const Description = ({ term, column, children, ...restProps }) => (
  <Col {...responsive[column]} {...restProps}>
    {term && <div className={styles.term}>{term}</div>}
    {children !== null && children !== undefined && <div className={styles.detail}>{children}</div>}
  </Col>
);
13

ddcat1115's avatar
ddcat1115 committed
14 15 16 17 18
Description.defaultProps = {
  term: '',
};

Description.propTypes = {
afc163's avatar
afc163 committed
19
  term: PropTypes.node,
ddcat1115's avatar
ddcat1115 committed
20 21
};

22
export default Description;