import React from 'react';
import './style.less';

class Section extends React.Component {
  get currentPage() {
    const { hash } = window.location;
    if (hash) {
      return hash.split('/').slice(-1)[0];
    }
    return window.location.hash;
  }

  render() {
    const { hasSimulator, children } = this.props;

    return (
      <div
        className={
          hasSimulator
            ? 'wgoo-doc-container wgoo-doc-row wgoo-doc-container--with-simulator'
            : 'wgoo-doc-container wgoo-doc-row'
        }
      >
        <div className='page-content'>
          <div className='react-doc-page-content'>{children}</div>
        </div>
      </div>
    );
  }
}

export default Section;
