import Image from "next/image"; import Link from "next/link"; import { notFound } from "next/navigation"; import type { Metadata } from "next"; import { games, getGame } from "@/lib/games"; import { getPostsByGame } from "@/lib/devblog"; import { SITE_URL } from "@/lib/site"; function formatDate(date: string) { return new Date(date).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", }); } type Props = { params: Promise<{ slug: string }> }; export function generateStaticParams() { return games.map((g) => ({ slug: g.slug })); } export async function generateMetadata({ params }: Props): Promise { const { slug } = await params; const game = getGame(slug); if (!game) return {}; return { title: game.title, description: game.tagline, }; } const statusLabel: Record = { "in-development": "IN DEVELOPMENT", released: "RELEASED", "coming-soon": "COMING SOON", }; export default async function GamePage({ params }: Props) { const { slug } = await params; const game = getGame(slug); if (!game) notFound(); const relatedPosts = getPostsByGame(slug).slice(0, 3); const jsonLd = { "@context": "https://schema.org", "@type": "VideoGame", name: game.title, description: game.description, genre: game.genres, publisher: { "@type": "Organization", name: "Highland Games Studio", url: SITE_URL, }, url: `${SITE_URL}/games/${game.slug}`, }; return (