Files
peworkshop/app/(main)/stats/[teamId]/page.js
T
2025-03-11 16:22:47 +00:00

24 lines
732 B
JavaScript

import { query } from '../../../lib/db';
export default async function Stats({ params }) {
const { teamId } = params;
// Fetch team and clues from the database
const team = await query('SELECT * FROM teams WHERE id = ?', [teamId]);
const clues = await query('SELECT * FROM clues WHERE team_id = ?', [teamId]);
return (
<div>
<h1>Stats for {team.name}</h1>
<p>Team Code: {team.code}</p>
<h2>Clues</h2>
<ul>
{clues.map((clue) => (
<li key={clue.id}>
{clue.description} - {clue.found ? 'Found' : 'Not Found'}
</li>
))}
</ul>
</div>
);
}