import '../styles/cardGames.css'
import { handleGameImageError } from '../utils'

type GameCardProps = {
  title: string
  imageUrl: string
}

export const GameCard = ({ title, imageUrl }: GameCardProps) => {
  return (
    <a className='cardGameMainWrapperLink' href='search.html'>
      <img
        src={imageUrl}
        onError={handleGameImageError}
        className='cardGameMain'
      />
      <div className='cardGameMainTitle'>
        <p>{title}</p>
      </div>
    </a>
  )
}
