src/components/CompletedPollChoice.js
/**
 * Displays a poll choice that has already been voted on.
 */
Displays a poll choice that has already been voted on.
Displays a poll choice that has already been voted on .
function CompletedPollChoice({ percentVote, isWinner, choice }) {
  return (
    <div className="cvPollChoice">
      <span className="cvPollChoiceDetails">
        <span className="cvChoicePercentage">
          {
          }
          {Math.round(percentVote * 10) / 10}%
        </span>
        <span className="cvChoiceText">
          {choice.text}
        </span>
      </span>
      {
      }
      <span className={isWinner ? 'cvChoicePercentChart winner': 'cvChoicePercentChart'}
            style={{ width: percentVote + '%' }}>
      </span>
    </div>
  );
}
function CompletedPollChoice ( { percentVote , isWinner , choice } ) { return ( < div className = "cvPollChoice" > < span className = "cvPollChoiceDetails" > < span className = "cvChoicePercentage" > { } { Math . round ( percentVote * 10 ) / 10 } %
         < / span > < span className = "cvChoiceText" > { choice . text } < / span > < / span > { } < span className = { isWinner ? 'cvChoicePercentChart winner' : 'cvChoicePercentChart' } style = { { width : percentVote + '%' } } > < / span > < / div > ) ; }
Displays a poll choice that has already been voted on.
Displays a poll choice that has already been voted on .
// simple rounding to make percentages look nicer // if a choice is the winner, use special styling