diff --git a/app/game/[id]/game-page-client.tsx b/app/game/[id]/game-page-client.tsx index 3f46be8..8957441 100644 --- a/app/game/[id]/game-page-client.tsx +++ b/app/game/[id]/game-page-client.tsx @@ -883,7 +883,7 @@ export function GamePageClient({ {/* Desktop hero โ€” side-by-side layout */}
{/* Cover image */} -
+
{coverImage && !imgError ? ( | null + screenshots: Array<{ + id: string + url: string + width: number + height: number + }> | null hardwareWattHours: number | null hardwareDeviceType: string | null customSystem: boolean @@ -96,15 +101,22 @@ function MetaItem({ value: React.ReactNode | string | null }) { return ( -
- {label} - {value ?? "โ€”"} +
+ {label} + + {value ?? "โ€”"} +
) } function hasPerformanceData(p: Preset): boolean { - return p.fpsAvg !== null || p.fpsOnePercentLow !== null || p.loadTimeSsd !== null || p.loadTimeSd !== null + return ( + p.fpsAvg !== null || + p.fpsOnePercentLow !== null || + p.loadTimeSsd !== null || + p.loadTimeSd !== null + ) } function hasHardwarePowerData(p: Preset): boolean { @@ -112,7 +124,13 @@ function hasHardwarePowerData(p: Preset): boolean { } function hasSoftwareData(p: Preset): boolean { - return !!(p.protonVersion || p.osVersion || (p.upscalerType && p.upscalerType !== "none") || (p.frameGenMethod && p.frameGenMethod !== "none") || p.launchOptions) + return !!( + p.protonVersion || + p.osVersion || + (p.upscalerType && p.upscalerType !== "none") || + (p.frameGenMethod && p.frameGenMethod !== "none") || + p.launchOptions + ) } function hasGameInfoData(p: Preset): boolean { @@ -159,20 +177,28 @@ export function PresetDetailModal({ const categories = preset.settingsJson ?? [] const hasCategories = categories.length > 0 - const currentCategory = hasCategories ? categories[activeCategoryIndex] : null + const currentCategory = hasCategories + ? categories[activeCategoryIndex] + : null const goPrevCategory = () => { - setActiveCategoryIndex((prev) => (prev > 0 ? prev - 1 : categories.length - 1)) + setActiveCategoryIndex((prev) => + prev > 0 ? prev - 1 : categories.length - 1, + ) } const goNextCategory = () => { - setActiveCategoryIndex((prev) => (prev < categories.length - 1 ? prev + 1 : 0)) + setActiveCategoryIndex((prev) => + prev < categories.length - 1 ? prev + 1 : 0, + ) } const handleUpvote = async () => { if (!isAuthenticated || userVote === "up") return try { - const res = await fetch(`/api/performance/${preset.id}/upvote`, { method: "POST" }) + const res = await fetch(`/api/performance/${preset.id}/upvote`, { + method: "POST", + }) if (res.ok) { if (userVote === "down") setLocalDownvotes((d) => d - 1) setLocalUpvotes((u) => u + 1) @@ -186,7 +212,9 @@ export function PresetDetailModal({ const handleDownvote = async () => { if (!isAuthenticated || userVote === "down") return try { - const res = await fetch(`/api/performance/${preset.id}/downvote`, { method: "POST" }) + const res = await fetch(`/api/performance/${preset.id}/downvote`, { + method: "POST", + }) if (res.ok) { if (userVote === "up") setLocalUpvotes((u) => u - 1) setLocalDownvotes((d) => d + 1) @@ -206,7 +234,9 @@ export function PresetDetailModal({ const handleTogglePin = async () => { const method = preset.isPinned ? "DELETE" : "POST" try { - const res = await fetch(`/api/performance/${preset.id}/pin`, { method }) + const res = await fetch(`/api/performance/${preset.id}/pin`, { + method, + }) if (res.ok) { router.refresh() } @@ -223,8 +253,8 @@ export function PresetDetailModal({ <> {/* Backdrop */} {/* Modal card */} e.stopPropagation()} > {/* Header */} -
-
-

+
+
+

{preset.hardwareName}

{/* Mobile tabs */} -
+
{visibleTabs.map((tab) => ( ))}
{/* Two-column body */} -
+
{/* Left panel โ€” Details (always visible on desktop, tab on mobile) */} -
+
{/* User info */} -
-
+
+
{preset.userImage ? ( {preset.userName ) : ( - + )}
-
-
- +
+
+ {preset.userName || "Anonymous"} {preset.verifiedAt && ( - - - - Verified on {new Date(preset.verifiedAt).toLocaleDateString(undefined, { year: "numeric", month: "short", day: "numeric" })} + + + + Verified on{" "} + {new Date( + preset.verifiedAt, + ).toLocaleDateString( + undefined, + { + year: "numeric", + month: "short", + day: "numeric", + }, + )} )}
- + {formatDate(preset.createdAt)}
-
+
{/* Actions */} -
+
{isAdmin && ( )} {(isOwner || isAdmin) && ( <> {!showDeleteConfirm ? ( ) : ( -
- Are you sure? +
+ + Are you sure? + @@ -370,59 +438,91 @@ export function PresetDetailModal({ )} {(isOwner || isAdmin) && ( )} {session && !hasReported && ( <> {!showReportForm ? ( ) : ( -
+