import type { MatchInfo } from 'requests'

import type { SportTypes } from 'config'

import type { Match } from 'features/BuyMatchPopup/types'

type Args = {
  matchId: number,
  profile: NonNullable<MatchInfo>,
  sportType: SportTypes,
}

export const prepareMatchProfile = ({
  matchId,
  profile,
  sportType,
}: Args): Match => ({
  calc: profile.calc,
  hasVideo: profile.has_video,
  id: matchId,
  sportType,
  team1: profile.team1,
  team2: profile.team2,
  tournament: profile.tournament,
})
