11import Image from "next/image" ;
2+ import Link from "next/link" ;
23import { useRouter } from "next/router" ;
34import React from "react" ;
45import { SocialIcon } from "react-social-icons" ;
56
67import { GameEmbed } from "@/components/ui/GameEmbed" ;
78import { ItchEmbed } from "@/components/ui/ItchEmbed" ;
9+ import { useEvent } from "@/hooks/useEvent" ;
810import { useGame } from "@/hooks/useGames" ;
911
1012export default function IndividualGamePage ( ) {
@@ -17,6 +19,9 @@ export default function IndividualGamePage() {
1719 error,
1820 isError,
1921 } = useGame ( router . isReady ? id : undefined ) ;
22+ const { data : eventData } = useEvent (
23+ game ?. event ? String ( game . event ) : undefined ,
24+ ) ;
2025
2126 if ( isPending ) {
2227 return (
@@ -55,6 +60,8 @@ export default function IndividualGamePage() {
5560 const gameEmbedID = game . itchGameEmbedID ;
5661 const gameWidth = game . itchGameWidth ;
5762 const gameHeight = game . itchGameHeight ;
63+ const eventID = game . event ;
64+ const eventName = eventData ?. name || "" ;
5865
5966 const completionLabels : Record < number , string > = {
6067 1 : "WIP" ,
@@ -65,8 +72,6 @@ export default function IndividualGamePage() {
6572
6673 const devStage = completionLabels [ game . completion ] ?? "Stage Unknown" ;
6774
68- // TODO ADD EVENT
69- const event = "Game Jam November 2025" ;
7075 // TODO ADD ARTIMAGES
7176 const artImages : { src : string ; alt : string } [ ] = [ ] ;
7277 // const artImages = [
@@ -129,12 +134,12 @@ export default function IndividualGamePage() {
129134 key = { c . member_id }
130135 className = "flex items-center gap-x-2"
131136 >
132- < a
137+ < Link
133138 href = { `/members/${ c . member_id } ` }
134139 className = "text-primary hover:underline"
135140 >
136141 { c . name }
137- </ a >
142+ </ Link >
138143 { Array . isArray ( c . social_media ) &&
139144 c . social_media . map ( ( sm ) => (
140145 < SocialIcon
@@ -175,7 +180,20 @@ export default function IndividualGamePage() {
175180 < td className = "py-1 pr-2 text-muted-foreground sm:py-2" >
176181 Event
177182 </ td >
178- < td className = "py-1 text-right sm:py-2" > { event } </ td >
183+ < td className = "py-1 text-right sm:py-2" >
184+ { eventID && eventName ? (
185+ < Link
186+ href = { `/events/${ eventID } ` }
187+ className = "text-primary hover:underline"
188+ >
189+ { eventName }
190+ </ Link >
191+ ) : (
192+ < span className = "text-muted-foreground" >
193+ No past/upcoming event
194+ </ span >
195+ ) }
196+ </ td >
179197 </ tr >
180198 </ tbody >
181199 </ table >
0 commit comments