"use client"; import { useEffect, useState } from "react"; import Link from "next/link"; import { usePlaceDetails } from "@/hooks/roblox/usePlaceDetails"; import { RobloxVerifiedSmall } from "@/components/roblox/RobloxTooltips"; import { useGameLaunch } from "@/components/providers/GameLaunchProvider"; import LazyLoadedImage from "@/components/util/LazyLoadedImage"; import { Badge } from "@/components/ui/badge"; import { PlayGameButton } from "@/components/roblox/PlayGameButton"; interface GamePageContentProps { placeId: string; shouldSetDocumentTitle?: boolean; } export default function GamePageContent({ placeId, shouldSetDocumentTitle = true }: GamePageContentProps) { const game = usePlaceDetails(placeId); const [hasHydrated, setHasHydrated] = useState(false); // Set dynamic document title useEffect(() => { if (!shouldSetDocumentTitle) return; if (!!game) { document.title = `${game.name} | Roblox`; } }, [game, shouldSetDocumentTitle]); useEffect(() => { setHasHydrated(true); }, []); if (!hasHydrated || !game) { return (
{Array.from({ length: 4 }).map((_, index) => (
))}
); } const avatarTypeLabel = game.universeAvatarType === "MorphToR15" ? "R15 Only" : game.universeAvatarType === "MorphToR6" ? "R6 Only" : null; return (

{game.name}

{!game.isAllGenre && ( <> {game.genre && game.genre !== "All" ? ( {game.genre} ) : null} {game.genre_l1 && game.genre_l1 !== "All" ? ( {game.genre_l1} ) : null} {game.genre_l2 && game.genre_l2 !== "All" ? ( {game.genre_l2} ) : null} )} {game.maxPlayers === 1 ? ( Singleplayer ) : null} {game.copyingAllowed ? ( Uncopylocked ) : null} {avatarTypeLabel ? ( {avatarTypeLabel} ) : null}

Playing now

{game.playing.toLocaleString()}

Total visits

{game.visits.toLocaleString()}

Favorites

{game.favoritedCount.toLocaleString()}

Max players

{game.maxPlayers}

{game.creator.name} {game.creator.hasVerifiedBadge ? ( ) : null}

About

{game.description || "No description provided yet."}

); }