import { api } from "@/trpc/server";
import { notFound } from "next/navigation";
import React from "react";
import LobbyPage from "@/app/_components/lobby/lobby-page";

async function Page({
  params,
}: {
  params: Promise<{
    id: string;
  }>;
}) {
  const { id } = await params;
  const lobby = await api.lobby.get({ id });
  if (!lobby) return <div>Lobby not found</div>;

  return <LobbyPage initialLobby={lobby} />;
}

export default Page;
