import { Fragment } from 'react' import isEmpty from 'lodash/isEmpty' import { useMatchPageStore } from 'features/MatchPage/store' import { StreamPlayer } from 'features/StreamPlayer' import { YoutubePlayer } from 'features/StreamPlayer/components/YoutubePlayer' import { MatchSidePlaylists } from 'features/MatchSidePlaylists' import { isMobileDevice } from 'config/userAgent' import { Container } from '../../styled' import { useLiveMatch } from './hooks' import { TournamentData } from '../../types' import { MatchDescription } from '../MatchDescription' import { MatchProfileCardMobile } from '../MatchProfileCardMobile' type Props = { tournamentData: TournamentData, } export const LiveMatch = ({ tournamentData, }: Props) => { const { events, matchPlaylists, profile, selectedPlaylist, } = useMatchPageStore() const { chapters, onDurationChange, onPlayerProgressChange, onPlayingChange, onPlaylistSelect, resume, streamUrl, } = useLiveMatch() return ( {profile?.youtube_link ? ( ) : ( !isEmpty(chapters) && ( ) )} {isMobileDevice ? : ( )} ) }