import type { Match } from 'features/Matches'

import { CardFrontside } from './CardFrontside'
import { useCard } from './hooks'

type Props = {
  match: Match,
}

export const MatchCard = ({ match }: Props) => {
  const {
    onKeyPress,
    onMatchClick,
  } = useCard(match)

  return (
    <CardFrontside
      match={match}
      onClick={onMatchClick}
      onKeyPress={onKeyPress}
    />
  )
}
