import { useContestStatus } from "../../../../../hooks/election/index.js";
import classes from './styles.module.scss';
import IconBlock from './IconBlock';
import Candidate from '../../Candidate';
const Flip = function Flip(props) {
  const {
    candidatesToShow,
    contestId
  } = props;
  const {
    winningParty
  } = useContestStatus(contestId);
  return <div className={classes.container}>
      <IconBlock party={winningParty} />
      {candidatesToShow.map(candidateId => <Candidate key={candidateId} candidateId={candidateId} contestId={contestId} />)}
    </div>;
};
export default Flip;