content: import React from 'react'
  import BattlePrompt from '../components/BattlePrompt'
  import CourseHelpers from '../utils/CourseHelpers'
  
  class BattleContainer extends React.Component {
    static contextTypes = {
      router: React.PropTypes.object.isRequired
    }
  
    state = {
      isLoading: true,
      coursesInfo: []
    }
    componentDidMount() {
      let query = this.props.location.query
      let that = this
      CourseHelpers.getCoursesInfo([1,2])
        .then((courses) => {
          that.setState({
            isLoading: false,
            coursesInfo: [courses[0], courses[1]]
          })
        })
  
    }
    handleStartBattle() {
      this.context.router.push({
        pathname: '/results',
        state: {
          coursesInfo: this.state.coursesInfo
        }
      })
    }
    render() {
      return (
        <BattlePrompt
          isLoading={this.state.isLoading}
          coursesInfo={this.state.coursesInfo}
          onStartBattle={this.handleStartBattle.bind(this)}
        />
      )
    }
  }
  
  export default BattleContainer
  