<commit_before>import React from 'react'
import style from './PageHeader.scss'
import classnames from 'classnames'

export default (children) => {
  return <div className={classnames(style.header, 'bp-page-header')}>
    {children}
  </div>
}
<commit_msg>Refactor PageHeader component to React component<commit_after>import React, { Component } from 'react'
import PropTypes from 'prop-types'

import style from './PageHeader.scss'
import classnames from 'classnames'

import { connect } from 'nuclear-js-react-addons'
import getters from '~/stores/getters'

@connect(props => ({ 
  UI: getters.UI
}))

class PageHeader extends Component {
  static contextTypes = {
    router: PropTypes.object.isRequired
  }

  constructor(props, context) {
    super(props, context)
  }

  render() {
    const hasHeader = this.props.UI.get('viewMode') <= 2
    const hasSidebar = this.props.UI.get('viewMode') < 1

    if (!hasHeader) {
      return null
    }

    const classNames = classnames({
      [style.header]: true,
      'bp-page-header': true,
      [style.noSidebar]: !hasSidebar,
      'bp-page-header-no-sidebar': !hasSidebar
    })

    return <div className={classNames}>
        {this.props.children}
      </div>
  }
}

PageHeader.contextTypes = {
  reactor: PropTypes.object.isRequired
}

export default PageHeader

{'fraction_non_alphanumeric': 0.12859304084720122, 'fraction_numerical': 0.0015128593040847202, 'mean_word_length': 3.59375, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6875426', 'n_tokens_mistral': 421, 'n_tokens_neox': 413, 'n_words': 101}