 {CCDashboardStore, CCDashboardActions} = require '../../flux/cc-dashboard'
 ChapterSection = require '../task-plan/chapter-section'
 LoadableItem = require '../loadable-item'
+Router = require 'react-router'
 
 DashboardSectionProgress = React.createClass
   _getPercentage: (num, total) ->

    periods = CCDashboardStore.getPeriods(courseId)
    periodChapters = CCDashboardStore.getPeriodChapters(courseId, @state.activePeriodId)

    chapters = _.map periodChapters, @renderChapters

    <BS.Panel className='reading-stats'>
      <CoursePeriodsNav

  render: ->
    {courseId} = @context.router.getCurrentParams()

    <div>
      <h1>
        Class Performance
        <Router.Link className='btn btn-default pull-right' to='viewScores' params={{courseId}}>
          View Detailed Scores
        </Router.Link>
      </h1>
      <LoadableItem
        store={CCDashboardStore}
        actions={CCDashboardActions}
        id={courseId}
        renderItem={-> <CCDashboard key={courseId} id={courseId} />}
      />
    </div>

module.exports = DashboardShell

