import { formatNumber } from "../../../utils/election/index.js";
const getFormats = function getFormats({
  progress = {},
  status = {}
}) {
  const {
    tabulation
  } = status;
  if (tabulation === 'before') {
    return {
      className: 'before',
      short: 'Polls not closed',
      full: 'Waiting for polls to close'
    };
  }
  const {
    mode,
    pct,
    reporting,
    total
  } = progress;
  const className = 'active';
  const percent = formatNumber(pct, {
    format: 'percent'
  });
  if (mode === 'precinctsReporting') {
    const fraction = `${formatNumber(reporting)}/${formatNumber(total)}`;
    return {
      className,
      short: `${fraction} precincts`,
      full: `${fraction} precincts reporting (${percent})`
    };
  }
  return {
    className,
    short: `${percent} in`,
    full: `${percent} of expected vote in`
  };
};
export default getFormats;