import { getStateName, getPartyName } from "../../../../utils/election/index.js";
import { intcomma } from 'journalize';
export default function getHeadline({
  total,
  state,
  party,
  isComplete
}) {
  const partyName = getPartyName(party, {
    format: 'abbr'
  });
  const stateName = getStateName(state);
  const totalComma = intcomma(total);
  if (isComplete) {
    return `All ${totalComma} ${partyName} delegates have been awarded in ${stateName}`;
  }
  return `${totalComma} ${partyName} delegates are up for grabs in ${stateName}`;
}