<commit_before>import React, { Component } from 'react'
import axios from 'axios'
import Tabs from 'react-responsive-tabs'
import Iframe from 'react-iframe'
import 'react-responsive-tabs/styles.css'

class ContentPageContainer extends Component {
  constructor(props) {
    super(props)
    this.getTabs = this.getTabs.bind(this)
    this.getData = this.getData.bind(this)

    this.getData(res => {
      this.data = res
      this.data = this.data.bind(this)
    })
    
  }
  
  getData(cb) {
    // get data from JSON
    axios.get(this.props.filePath)
      .then(res => {
        // this.setState({
        //   data: res.data
        // })
        cb(res.data)
      })
  }
  
  getTabs() {
    var data = this.data
    return data.map(item => ({
      tabClassName: 'tab',
      panelClassName: 'panel',
      title: item.title,
      getContent: () => {
        return (
          <div>
            <div className='tabContent' dangerouslySetInnerHTML={{__html: item.text}} />
            {item.video && <Iframe     
                            url={item.video}
                            width="560px"
                            height="315px"
                            position="relative"
                            allowFullScreen />}
            <div className='tabLinks'>
              {item.links && item.links.map(link => {
                return <div><a href={link.url}>{link.title}</a><br/></div>
              })}
            </div>
          </div>
        )
      },
    }));
  }
  render() {
    var data = this.data
    return (
      <div className="wrapper">
        <h1>{data.title}</h1>
        {data.summary}
        {data.topLevelVideo && <Iframe     
                            url={data.topLevelVideo}
                            width="560px"
                            height="315px"
                            position="relative"
                            allowFullScreen />}
        {data.tab && <Tabs items={this.getTabs()} />}
      </div>
    )
  }
}
export default ContentPageContainer<commit_msg>fixed PageContainer data retrieval issue<commit_after>import React, { Component } from 'react'
import axios from 'axios'
import Tabs from 'react-responsive-tabs'
import Iframe from 'react-iframe'
import 'react-responsive-tabs/styles.css'

class ContentPageContainer extends Component {
  constructor(props) {
    super(props)
    this.state = {
      data: this.getData()
    }
    this.getTabs = this.getTabs.bind(this)
  }
  
  getData() {
    // get data from JSON
    axios.get(this.props.filePath)
      .then(res => {
        this.setState({
          data: res.data
        })
      })
  }
  
  getTabs() {
    var data = this.state.data
    return data.map(item => ({
      tabClassName: 'tab',
      panelClassName: 'panel',
      title: item.title,
      getContent: () => {
        return (
          <div>
            <div className='tabContent' dangerouslySetInnerHTML={{__html: item.text}} />
            {item.video && <Iframe     
                            url={item.video}
                            width="560px"
                            height="315px"
                            position="relative"
                            allowFullScreen />}
            <div className='tabLinks'>
              {item.links && item.links.map(link => {
                return <div><a href={link.url}>{link.title}</a><br/></div>
              })}
            </div>
          </div>
        )
      },
    }));
  }
  render() {
    var data = this.state.data
    return (
      <div className="wrapper">
        <h1>{data && data.title}</h1>
        {data && data.summary}
        {data && data.topLevelVideo && <Iframe     
                            url={data.topLevelVideo}
                            width="560px"
                            height="315px"
                            position="relative"
                            allowFullScreen />}
        {data && data.tab && <Tabs items={this.getTabs()} />}
      </div>
    )
  }
}
export default ContentPageContainer
{'fraction_non_alphanumeric': 0.13125309559187717, 'fraction_numerical': 0.006934125804853888, 'mean_word_length': 1.4345991561181435, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 46, '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': '2890763', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1150, 'n_words': 208}