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.
42 lines
717 B
42 lines
717 B
import React from 'react'
|
|
|
|
import type { Match } from 'features/Matches'
|
|
|
|
import { useCard } from '../hooks'
|
|
import { MatchInfoCard } from '../MatchInfoCard'
|
|
import { CardLiveHover } from '../CardLiveHover'
|
|
|
|
type CardLiveProps = {
|
|
match: Match,
|
|
showSportName?: boolean,
|
|
}
|
|
|
|
export const CardLive = ({
|
|
match,
|
|
showSportName,
|
|
}: CardLiveProps) => {
|
|
const {
|
|
close,
|
|
flipCard,
|
|
isOpen,
|
|
onKeyPress,
|
|
} = useCard(match.hasVideo)
|
|
|
|
if (isOpen) {
|
|
return (
|
|
<CardLiveHover
|
|
match={match}
|
|
onClose={close}
|
|
/>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<MatchInfoCard
|
|
match={match}
|
|
showSportName={showSportName}
|
|
onClick={flipCard}
|
|
onKeyPress={onKeyPress}
|
|
/>
|
|
)
|
|
}
|
|
|