index.js 623 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
import React from 'react';
import classNames from 'classnames';
import styles from './index.less';

export default ({ title, children, last, block, grid, ...rest }) => {
  const cls = classNames(styles.standardFormRow, {
    [styles.standardFormRowBlock]: block,
    [styles.standardFormRowLast]: last,
    [styles.standardFormRowGrid]: grid,
  });

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