2024-07-11 12:15:03 +00:00
|
|
|
import '../styles/cardGames.css'
|
2024-09-02 08:43:39 +00:00
|
|
|
import { handleGameImageError } from '../utils'
|
2024-07-11 12:15:03 +00:00
|
|
|
|
|
|
|
type GameCardProps = {
|
2024-09-02 08:43:39 +00:00
|
|
|
title: string
|
|
|
|
imageUrl: string
|
2024-07-11 12:15:03 +00:00
|
|
|
}
|
|
|
|
|
2024-09-02 08:43:39 +00:00
|
|
|
export const GameCard = ({ title, imageUrl }: GameCardProps) => {
|
2024-07-11 12:15:03 +00:00
|
|
|
return (
|
|
|
|
<a className='cardGameMainWrapperLink' href='search.html'>
|
2024-09-02 08:43:39 +00:00
|
|
|
<img
|
|
|
|
src={imageUrl}
|
|
|
|
onError={handleGameImageError}
|
2024-07-11 12:15:03 +00:00
|
|
|
className='cardGameMain'
|
2024-09-02 08:43:39 +00:00
|
|
|
/>
|
2024-07-11 12:15:03 +00:00
|
|
|
<div className='cardGameMainTitle'>
|
2024-09-02 08:43:39 +00:00
|
|
|
<p>{title}</p>
|
2024-07-11 12:15:03 +00:00
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
)
|
|
|
|
}
|