import { SportTypes } from 'config'

export type TournamentType = {
  id: number,
  is_super_tournament?: boolean,
  name_eng: string,
  name_rus: string,
}

type Team = {
  id: number,
  name_eng: string,
  name_rus: string,
  score?: number,
}

export type Match = {
  access: boolean,
  /** тип трансляции */
  c_type_broadcast: number,
  calc: boolean,
  country_id: number,
  date: string,
  /** Информация о турнире, если турнир входит в супер турнир */
  group: TournamentType,
  /** наличие mp4 видео */
  has_video: boolean,
  id: number,
  /** матч закончен */
  is_finished?: boolean,
  /** наличие hls стрима */
  live: boolean,
  preview?: string,
  previewURL?: string,
  sport: SportTypes,
  /** наличие завершенного hls стрима */
  storage: boolean,
  sub: boolean,
  team1: Team,
  team2: Team,
  tournament: TournamentType,
}

export type Matches = Array<Match>

type VideoContent = {
  broadcast: Matches,
  features: Matches,
  highlights: Matches,
}

export type MatchesResponse = {
  is_video_sections: boolean | null,
  show: boolean,
  video_content: VideoContent,
}

export type MatchesBySection = {
  broadcast: Matches,
  features: Matches,
  hasNextPage: boolean,
  highlights: Matches,
  isVideoSections: boolean,
}
