import ElectionIcon from "../../../../ElectionIcon/index.js";
import getColor from "../../../../../../utils/colors/getColor.js";
import getElectionPaletteColor from "../../../../../../utils/colors/getElectionPaletteColor.js";
import classes from './styles.module.scss';
const IconBlock = function IconBlock(props) {
  const {
    party
  } = props;
  const bg = getElectionPaletteColor(party, 'bgInverse');
  const backgroundColor = getColor(bg);
  const iconOptions = {
    gop: 'OutcomeFlipToGop',
    dem: 'OutcomeFlipToDem'
  };
  const iconType = iconOptions[party];
  if (!iconType) {
    return null;
  }
  return <span className={classes.container} style={{
    backgroundColor
  }}>
      <ElectionIcon type={iconType} size={3} />
    </span>;
};
export default IconBlock;