From 122fd9e09fe0adb83de7204a21d9c5c01ca154c4 Mon Sep 17 00:00:00 2001 From: sabarishr-dev Date: Sun, 28 Sep 2025 11:39:00 +0530 Subject: [PATCH 1/4] feat: html build upload --- app/api/arena/games/[id]/route.ts | 5 +- app/arena/[id]/page.tsx | 22 +- app/arena/play-game/page.tsx | 66 +++++- app/contribute/publish/page.tsx | 303 +++++++++++++++++++++++++-- components/html/html-game-view.tsx | 110 ++++++++++ components/html/html-game.module.css | 25 +++ lib/db.ts | 36 +++- package-lock.json | 22 -- pages/api/publish.ts | 145 +------------ pages/api/publish/html.ts | 158 ++++++++++++++ pages/api/publish/unity.ts | 147 +++++++++++++ 11 files changed, 847 insertions(+), 192 deletions(-) create mode 100644 components/html/html-game-view.tsx create mode 100644 components/html/html-game.module.css create mode 100644 pages/api/publish/html.ts create mode 100644 pages/api/publish/unity.ts diff --git a/app/api/arena/games/[id]/route.ts b/app/api/arena/games/[id]/route.ts index 958da7f..4f0e25c 100644 --- a/app/api/arena/games/[id]/route.ts +++ b/app/api/arena/games/[id]/route.ts @@ -3,10 +3,11 @@ import { getGameById } from '@/lib/db'; export async function GET( req: Request, - context: Promise<{ params: { id: string } }> + context: Promise<{ params: Promise<{ id: string }> }> ) { try { - const { id } = (await context).params; + const params = await context; + const { id } = await params.params; const gameId = parseInt(id); if (isNaN(gameId)) { diff --git a/app/arena/[id]/page.tsx b/app/arena/[id]/page.tsx index 47f9fe6..94c0889 100644 --- a/app/arena/[id]/page.tsx +++ b/app/arena/[id]/page.tsx @@ -18,6 +18,7 @@ interface Game { details: string; category: string[]; publisher: string; + type: string; } export default function GameDetailPage() { @@ -96,14 +97,24 @@ export default function GameDetailPage() { alt={`${game.title} preview ${activeIndex + 1}`} className={styles.previewImage} /> - ) : ( + ) : game.video ? (