export function getTeamLogo(team, isStorybook = false) {
  const teaamURL = team?.logo?.split('/');
  if (teaamURL && teaamURL.length > 2) {
    return `https://di0up76ym3ymc.cloudfront.net/fit-in/40x40/logos/team/${
      teaamURL[teaamURL.length - 2]
    }.png`;
  }
  return isStorybook ? './images/default.svg' : '../images/default.svg';
}

export const getOddsFractional = (decimal) => {
  let betAmount = 5;
  if (decimal > 5) {
    betAmount = 1;
  }
  const totalWin = (betAmount * decimal).toFixed(0);
  return `${totalWin - betAmount}/${betAmount}`;
};
