All files / ts/components/modals modal-body.tsx

100% Statements 12/12
100% Branches 2/2
100% Functions 2/2
100% Lines 10/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3020x 20x 20x                 20x 20x 6x 4x           2x           20x   20x  
import * as classNames from 'classnames';
import * as React from 'react';
import { HTMLProps, PureComponent } from 'react';
import { ComponentProps } from '../../types';
 
export type ModalBodyProps = ComponentProps & HTMLProps<HTMLElement>;
 
/**
 * Used within a `Modal` to contain the main content.
 * See the [Modal](#modal) section for a full example.
 */
export class ModalBody extends PureComponent<ModalBodyProps, {}> {
  public render () {
    const {
      className,
      children,
      component: Component = 'div',
      ...remainingProps
    } = this.props;
 
    return (
      <Component {...remainingProps} className={classNames('modal-body', className)}>
        {children}
      </Component>
    );
  }
}
 
export default ModalBody;