import { ServerGame } from "@/hooks/serverGame" import { GameId } from "../../convex/aiTown/ids"; export function EndGame({ game, playerId }: { game: ServerGame playerId: GameId<'players'> }) { const llms = [...game.world.playersInit.values()].filter(player => !player.human); const playerVotes = [...game.world.llmVotes].filter((vote) => vote.voter === playerId); if (playerVotes.length === 0) { return
You didn't vote
} const correctVotes = playerVotes[0].playerIds.filter((playerId) => llms.map(llm => llm.id).includes(playerId)); return ( <>You managed to guess {correctVotes.length} out of {llms.length}
The LLM were: {llms.map(llm => game.playerDescriptions.get(llm.id)?.name).join(', ')}
> ) }