{"size": 487, "ext": "js", "max_stars_repo_path": "components/container/StatsViewContainer.js", "max_stars_repo_name": "emersonsiega/FlashCards", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "components/container/StatsViewContainer.js", "max_issues_repo_name": "emersonsiega/FlashCards", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "components/container/StatsViewContainer.js", "max_forks_repo_name": "emersonsiega/FlashCards", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.35, "max_line_length": 74, "alphanum_fraction": 0.6735112936}
import React from 'react'
import { connect } from 'react-redux'

import StatsView from '../presentational/StatsView'

const StatsViewContainer = ({ stats = [] }) => <StatsView stats={stats} />

const mapStateToProps = ({ stats = {} }) => {
  const results = Object.values(stats).map(item => ({
    name: item.deck,
    lastResult: item.results ? item.results[0].result : undefined,
  }))

  return {
    stats: results,
  }
}

export default connect(mapStateToProps)(StatsViewContainer)
