You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/features/MatchPage/components/FinishedMatch/index.tsx

74 lines
1.7 KiB

import { Fragment } from 'react'
import isEmpty from 'lodash/isEmpty'
import type { Events } from 'requests/getMatchEvents'
import type { MatchInfo } from 'requests/getMatchInfo'
import { MatchSidePlaylists } from 'features/MatchSidePlaylists'
import { MultiSourcePlayer } from 'features/MultiSourcePlayer'
import { SettingsPopup } from '../SettingsPopup'
import { useFinishedMatch } from './hooks'
import { Container } from '../../styled'
import { Modal } from './styled'
import { TournamentData } from '../../types'
type Props = {
events: Events,
profile: MatchInfo,
tournamentData: TournamentData,
}
export const FinishedMatch = ({
events,
profile,
tournamentData,
}: Props) => {
const {
chapters,
closeSettingsPopup,
isSettingsPopupOpen,
onPlayingChange,
onPlaylistSelect,
playlists,
selectedPlaylist,
setEpisodesSettings,
} = useFinishedMatch()
return (
<Fragment>
<Modal
close={closeSettingsPopup}
isOpen={isSettingsPopupOpen}
withCloseButton={false}
>
<SettingsPopup
onWatchEpisodesClick={setEpisodesSettings}
closePopup={closeSettingsPopup}
profile={profile}
selectedPlaylist={selectedPlaylist}
/>
</Modal>
<Container>
{!isEmpty(chapters) && (
<MultiSourcePlayer
chapters={chapters}
onPlayingChange={onPlayingChange}
/>
)}
</Container>
<MatchSidePlaylists
events={events}
playlists={playlists}
selectedPlaylist={selectedPlaylist}
onSelect={onPlaylistSelect}
profile={profile}
tournamentData={tournamentData}
/>
</Fragment>
)
}