index.js 625 Bytes
Newer Older
1 2 3 4
import React from 'react';
import classNames from 'classnames';
import styles from './index.less';

ZHAO Jinxiang's avatar
ZHAO Jinxiang committed
5
const StandardFormRow = ({ title, children, last, block, grid, ...rest }) => {
6 7 8 9 10 11 12 13
  const cls = classNames(styles.standardFormRow, {
    [styles.standardFormRowBlock]: block,
    [styles.standardFormRowLast]: last,
    [styles.standardFormRowGrid]: grid,
  });

  return (
    <div className={cls} {...rest}>
jim's avatar
jim committed
14 15 16 17 18 19
      {title && (
        <div className={styles.label}>
          <span>{title}</span>
        </div>
      )}
      <div className={styles.content}>{children}</div>
20 21 22
    </div>
  );
};
ZHAO Jinxiang's avatar
ZHAO Jinxiang committed
23 24

export default StandardFormRow;