import {
  SportTypes,
  ProfileTypes,
  PROFILE_NAMES,
} from 'config'

const IMAGES_URLS = {
  [SportTypes.BASKETBALL]: 'https://basketball.instatscout.com/images',
  [SportTypes.FOOTBALL]: 'https://instatscout.com/images',
  [SportTypes.HOCKEY]: 'https://hockey.instatscout.com/images',
  [SportTypes.HANDBALL]: 'https://handball.instatscout.com/images',
  [SportTypes.STREETBALL]: 'https://streetball.instatscout.com/images',
  [SportTypes.VOLLEYBALL]: 'https://volleyball.instatscout.com/images',
}

type GetLogoArgs = {
  id: number,
  profileType: ProfileTypes,
  size?: number,
  sportType: SportTypes,
}

export const getProfileLogo = ({
  id,
  profileType,
  size = 180,
  sportType,
}: GetLogoArgs) => {
  const content = sportType === SportTypes.BOXING
    ? `https://images.insports.tv/${sportType}/${PROFILE_NAMES[profileType]}/${id}.png`
    : `${IMAGES_URLS[sportType]}/${PROFILE_NAMES[profileType]}/${size}/${id}.png`

  return content
}
