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/MatchCard/CardLive/index.tsx

40 lines
681 B

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)
if (isOpen) {
return (
<CardLiveHover
match={match}
onClose={close}
/>
)
}
return (
<MatchInfoCard
match={match}
showSportName={showSportName}
onClick={flipCard}
onKeyPress={onKeyPress}
/>
)
}