import { Fragment, useMemo, memo, } from 'react' import { T9n } from 'features/T9n' import { InfiniteScroll } from 'features/InfiniteScroll' import { Loader } from 'features/Loader' import { isMobileDevice } from 'config/userAgent' import type { Props } from './hooks' import { useMatches } from './hooks' import { MatchesList } from './components/MatchesList' import { Loading } from './styled' export const Matches = memo((props: Props) => { const { fetchMoreMatches, isFetching, matches: { broadcast, features, highlights, isVideoSections, }, } = useMatches(props) const mobileView = useMemo(() => ( isFetching ? ( ) : ( ) ), [isFetching, broadcast]) const desktopView = useMemo(() => ( <> {isFetching && ...} ), [isFetching, broadcast]) if (isVideoSections) { return ( ) } return ( {isMobileDevice ? mobileView : desktopView} ) })