integrate jury controls, bingo, leaderboard in host route
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,10 @@ import { useWebSocket } from "@/hooks/use-websocket"
|
||||
import { useRoomStore } from "@/stores/room-store"
|
||||
import { PlayerList } from "@/components/player-list"
|
||||
import { PredictionsForm } from "@/components/predictions-form"
|
||||
import { JuryHost } from "@/components/jury-host"
|
||||
import { JuryVoting } from "@/components/jury-voting"
|
||||
import { BingoCard } from "@/components/bingo-card"
|
||||
import { Leaderboard } from "@/components/leaderboard"
|
||||
import { RoomHeader } from "@/components/room-header"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
|
||||
@@ -48,7 +52,7 @@ function HostView() {
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
<TabsContent value="play" className="p-4">
|
||||
{gameState && room.currentAct !== "ended" && (
|
||||
{gameState && (room.currentAct === "lobby" || room.currentAct === "pre-show") && (
|
||||
<div className="flex flex-col gap-4">
|
||||
<PredictionsForm
|
||||
entries={gameState.lineup.entries}
|
||||
@@ -60,6 +64,45 @@ function HostView() {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{gameState && room.currentAct === "live-event" && (
|
||||
<Tabs defaultValue="jury">
|
||||
<TabsList className="w-full">
|
||||
<TabsTrigger value="jury" className="flex-1">Jury</TabsTrigger>
|
||||
<TabsTrigger value="bingo" className="flex-1">Bingo</TabsTrigger>
|
||||
</TabsList>
|
||||
<TabsContent value="jury" className="mt-4">
|
||||
{gameState.currentJuryRound ? (
|
||||
<JuryVoting
|
||||
round={gameState.currentJuryRound}
|
||||
myVote={gameState.myJuryVote}
|
||||
onVote={(rating) => send({ type: "submit_jury_vote", rating })}
|
||||
/>
|
||||
) : (
|
||||
<div className="py-8 text-center text-muted-foreground">
|
||||
Waiting for host to open voting...
|
||||
</div>
|
||||
)}
|
||||
</TabsContent>
|
||||
<TabsContent value="bingo" className="mt-4">
|
||||
{gameState.myBingoCard ? (
|
||||
<BingoCard
|
||||
card={gameState.myBingoCard}
|
||||
onTap={(tropeId) => send({ type: "tap_bingo_square", tropeId })}
|
||||
/>
|
||||
) : (
|
||||
<div className="py-8 text-center text-muted-foreground">
|
||||
No bingo card yet
|
||||
</div>
|
||||
)}
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
)}
|
||||
|
||||
{gameState && (room.currentAct === "scoring" || room.currentAct === "ended") && (
|
||||
<Leaderboard entries={gameState.leaderboard} />
|
||||
)}
|
||||
|
||||
<PlayerList
|
||||
players={room.players}
|
||||
mySessionId={mySessionId}
|
||||
@@ -92,6 +135,18 @@ function HostView() {
|
||||
The party has ended. Thanks for playing!
|
||||
</p>
|
||||
)}
|
||||
{room.currentAct === "live-event" && gameState && (
|
||||
<JuryHost
|
||||
entries={gameState.lineup.entries}
|
||||
currentRound={gameState.currentJuryRound}
|
||||
results={gameState.juryResults}
|
||||
onOpenVote={(countryCode) => send({ type: "open_jury_vote", countryCode })}
|
||||
onCloseVote={() => send({ type: "close_jury_vote" })}
|
||||
/>
|
||||
)}
|
||||
{gameState && (room.currentAct === "scoring" || room.currentAct === "ended") && (
|
||||
<Leaderboard entries={gameState.leaderboard} />
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
<PlayerList
|
||||
|
||||
Reference in New Issue
Block a user