"use server";
//https://github.com/vercel/next.js/discussions/63862
import React from "react";
import { Card, CardHeader, CardTitle } from "@/components/ui/card";
import { ChunithmGameVersionSelection } from "./gameSelection";
import { getGameList } from "./actions";

const getAllGamesChunithm = async () => {
  const gameVersions = await getGameList();
  return { gameVersions };
};

const Page = async () => {
  const AllChunithmVersions = await getAllGamesChunithm();

  return (
    <Card x-chunk="gameversions">
      <CardHeader>
        <CardTitle className="text-2xl">Update Game Versions</CardTitle>
      </CardHeader>
      <ChunithmGameVersionSelection
        chunithmGameVersionNumber={AllChunithmVersions}
      />
    </Card>
  );
};

export default Page;
