import { useEffect } from 'react'; import { connect } from 'react-redux'; import { Loader } from 'UI'; import { toggleFullscreen, closeBottomBlock } from 'Duck/components/player'; import { PlayerProvider, connectPlayer, init as initPlayer, clean as cleanPlayer, } from 'Player'; import { Controls as PlayerControls, toggleEvents } from 'Player'; import cn from 'classnames' import PlayerBlockHeader from '../Session_/PlayerBlockHeader'; import EventsBlock from '../Session_/EventsBlock'; import PlayerBlock from '../Session_/PlayerBlock'; import styles from '../Session_/session.css'; import EventsToggleButton from './EventsToggleButton'; const EventsBlockConnected = connectPlayer(state => ({ currentTimeEventIndex: state.eventListNow.length > 0 ? state.eventListNow.length - 1 : 0, playing: state.playing, }))(EventsBlock) const InitLoader = connectPlayer(state => ({ loading: !state.initialized }))(Loader); const PlayerContentConnected = connectPlayer(state => ({ showEvents: !state.showEvents }), { toggleEvents })(PlayerContent); function PlayerContent({ live, fullscreen, showEvents, toggleEvents }) { return (