add wrapper component to check auth

This commit is contained in:
Nathaniel Tampus
2023-03-05 10:00:55 +08:00
parent 01ebc4a138
commit 69fb7a7c9d
3 changed files with 29 additions and 9 deletions

View File

@@ -1,12 +1,12 @@
import GameWrapper from "@/components/game/GameWrapper";
import GameAuthWrapper from "@/components/game/GameAuthWrapper";
import { getGame } from "@/lib/game";
import { notFound } from "next/navigation";
export default async function GamePage({ params }: { params: { code: string } }) {
export default async function Game({ params }: { params: { code: string } }) {
const game = await getGame(params.code);
if (!game) {
notFound();
}
return <GameWrapper initialLobby={game} />;
return <GameAuthWrapper initialLobby={game} />;
}