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.
36 lines
840 B
36 lines
840 B
import type { Match } from 'helpers'
|
|
|
|
import { isMobileDevice } from 'config/userAgent'
|
|
|
|
import { LiveScore } from 'requests/getLiveScores'
|
|
|
|
import { CardFrontside } from './CardFrontside'
|
|
import { CardFrontsideMobile } from './CardFrontside/MatchCardMobile'
|
|
import { useCard } from './hooks'
|
|
|
|
type Props = {
|
|
match: Match,
|
|
score?: LiveScore,
|
|
}
|
|
|
|
export const MatchCard = ({ match, score }: Props) => {
|
|
const {
|
|
isNeedFormatTimeChanged,
|
|
isOwnedMatches,
|
|
onKeyPress,
|
|
onMatchClick,
|
|
} = useCard(match)
|
|
|
|
const CurrentComponent = isMobileDevice ? CardFrontsideMobile : CardFrontside
|
|
|
|
return (
|
|
<CurrentComponent
|
|
match={match}
|
|
onClick={onMatchClick}
|
|
onKeyPress={onKeyPress}
|
|
isNeedFormatTimeChanged={isNeedFormatTimeChanged}
|
|
isOwnedMatches={isOwnedMatches}
|
|
score={score}
|
|
/>
|
|
)
|
|
}
|
|
|