import get from 'lodash/get';
const leaderThreshold = {
  president: 100,
  senate: 7,
  house: 45
};
const getIsEarly = function getIsEarly({
  bop,
  office
}) {
  if (!bop) return true;
  const calledDem = get(bop, 'bop.calledDem', 0);
  const calledGop = get(bop, 'bop.calledGop', 0);
  const calledTotal = calledDem + calledGop;
  const calledThreshold = get(leaderThreshold, office, calledTotal + 1);
  if (calledTotal < calledThreshold) return true;
  return false;
};
export default getIsEarly;