import React from 'react';
import PureRenderMixin from 'react-addons-pure-render-mixin';
import {connect} from 'react-redux';
import Winner from './Winner';
import * as actionCreators from '../action_creators';
export const VOTE_WIDTH_PERCENT = 8;
export const Results = React.createClass({
mixins: [PureRenderMixin],
getPair: function () {
return this.props.pair || [];
},
getVotes: function(entry) {
if (this.props.tally && this.props.tally.has(entry)) {
return this.props.tally.get(entry);
}
return 0;
},
getVotesBlockWidth: function(entry) {
console.log(entry);
console.log(this.getVotes(entry));
return (this.getVotes(entry) * VOTE_WIDTH_PERCENT) + '%';
},
render: function () {
return this.props.winner ?