import * as React from 'react';
import * as classNames from 'classnames';
import {HTMLProps, SFC} from 'react';
import {Scrollbars} from './../';

export interface PageBodyProps extends HTMLProps<HTMLDivElement> {
  fullscreen?: boolean;
  noScrollbars?: boolean;
}

export const PageBody: SFC<PageBodyProps> = ({children, fullscreen, noScrollbars, ...otherProps}: PageBodyProps) => (
  <div
    className={classNames(
      'page-comp-body',
      {'page-comp-body-fullscreen': fullscreen},
    )}
    {...otherProps}
  >
    {noScrollbars ? children : (
      <Scrollbars>
        {children}
      </Scrollbars>
    )}
  </div>
);

PageBody.displayName = 'PageBody';

PageBody.defaultProps = {
  fullscreen: false,
};
