import { useContestStatus } from "../../../../hooks/election/index.js";
import getElectionPaletteColor from "../../../../utils/colors/getElectionPaletteColor.js";
import getColor from "../../../../utils/colors/getColor.js";
import classes from './styles.module.scss';
import partyOptions from './partyOptions';
const Held = function Held(props) {
  const {
    contestId,
    size
  } = props;
  const contestStatus = useContestStatus(contestId);
  const {
    winningParty
  } = contestStatus;
  const fg = getElectionPaletteColor(winningParty, 'fgColored');
  const color = getColor(fg);
  if (!partyOptions[winningParty]) {
    return null;
  }
  const {
    text: textOptions
  } = partyOptions[winningParty];
  const text = textOptions[size];
  return <span className={classes.container} style={{
    color
  }}>
      {text}
    </span>;
};
export default Held;