๐Ÿ“ฆ Svenlaa / video-gamer

๐Ÿ“„ game.tsx ยท 38 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38import Image from 'next/image'
import Link from 'next/link'
import getImageUrl from '../../utils/getImageUrl'

const Game = ({
  title,
  slug,
  imgUrl,
  releaseDate
}: {
  title: string
  slug: string
  imgUrl: string
  releaseDate: string
}) => {
  return (
    <li>
      <Link href={`/game/${slug}`}>
        <a className="flex flex-row gap-2 p-1 text-left hover:text-rose-500">
          <div className="relative row-span-3 h-16 w-10">
            <Image
              src={getImageUrl(imgUrl)}
              layout="fill"
              alt={title + 'cover'}
            />
          </div>
          <div className="flex flex-col">
            <span className="font-semibold">{title}</span>
            <span>{releaseDate}</span>
          </div>
        </a>
      </Link>
    </li>
  )
}

export default Game