Description.js 700 Bytes
Newer Older
1
import React from 'react';
ddcat1115's avatar
ddcat1115 committed
2
import PropTypes from 'prop-types';
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import classNames from 'classnames';
import { Col } from 'antd';
import styles from './index.less';
import responsive from './responsive';

const Description = ({ term, column, className, children, ...restProps }) => {
  const clsString = classNames(styles.description, className);
  return (
    <Col className={clsString} {...responsive[column]} {...restProps}>
      {term && <div className={styles.term}>{term}</div>}
      {children && <div className={styles.detail}>{children}</div>}
    </Col>
  );
};

ddcat1115's avatar
ddcat1115 committed
18 19 20 21 22
Description.defaultProps = {
  term: '',
};

Description.propTypes = {
afc163's avatar
afc163 committed
23
  term: PropTypes.node,
ddcat1115's avatar
ddcat1115 committed
24 25
};

26
export default Description;