import { getGame, getGames } from "@/lib/igdb";
import { IGame } from "@/types/igdb-types";
import Image from "next/image";

// renders a single game detail page
export default async function GameDetail({ params }: { params: { gameid: string } }) {
    const data: IGame[] = await getGame(parseInt(params.gameid))

    return (
        <div>
            <h1>Game Detail</h1>
            <h1>{data[0].name}</h1>
            <Image src={data[0].cover.url} alt={data[0].name} width={264} height={374} priority={true} style={{ width: 'auto', height: 'auto' }} />
            <p>{data[0].summary}</p>
        </div>
    )
}