const candidateResult = function candidateResult({
  result,
  contestId,
  totalVotes
}) {
  const {
    id,
    votes,
    ...restData
  } = result;
  const votesPercent = totalVotes > 0 ? votes / totalVotes : 0;
  return {
    id: `candidate:${id}::${contestId}`,
    votes,
    votesPercent,
    ...restData
  };
};
export default candidateResult;