---
import { type CollectionEntry, getCollection } from "astro:content";
import GameLayout from "../../layouts/GameLayout.astro";

export async function getStaticPaths() {
  const games = await getCollection("games");
  return games.map((story) => ({
    params: { slug: story.slug },
    props: story,
  }));
}
type Props = CollectionEntry<"games">;

const story = Astro.props;
const { Content } = await story.render();
---

<GameLayout {...story.data}>
  <Content />
</GameLayout>