import { SportTypes } from 'config'

import type { Match } from 'features/Matches/hooks'

export type MatchData = Pick<Match, (
  'calc'
  | 'id'
  | 'team1'
  | 'team2'
  | 'sportType'
  | 'live'
)> | null

export enum PopupPages {
  MATCH_SETTINGS = 'MATCH_SETTINGS',
  PLAYER_SETTINGS = 'PLAYER_SETTINGS',
  PLAYLIST = 'PLAYLIST',
}

export enum PlayerPlaylistFormats {
  ALL_MATCH_TIME = 1,
  ALL_ACTIONS = 2,
  SELECTED_ACTIONS = 3,
}

export type SelectedActions = Array<number>
export type EpisodeDuration = {
  after: number,
  before: number,
}
export type Settings = {
  episodeDuration: EpisodeDuration,
  selectedActions: SelectedActions,
  selectedFormat: PlayerPlaylistFormats,
}

export type SettingsBySport = Partial<Record<SportTypes, Settings>>

export const defaultSettings: Settings = {
  episodeDuration: {
    after: 30,
    before: 10,
  },
  selectedActions: [],
  selectedFormat: PlayerPlaylistFormats.ALL_MATCH_TIME,
}
