Skip to content

Commit

Permalink
Prize distribution, finalist
Browse files Browse the repository at this point in the history
  • Loading branch information
carletex committed Sep 6, 2024
1 parent a231994 commit d17a5ad
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/nextjs/app/submissions/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,24 @@ const Submissions: NextPage = async () => {
? submission.votes.map(vote => vote.score).reduce((a, b) => a + b, 0) / submission.votes.length
: 0;

const winnerTag = avgScore >= winnersThreshold ? "Winner" : avgScore >= runnersUpThreshold ? "Runner Up" : null;
const winnerTag = avgScore >= winnersThreshold ? "Winner" : avgScore >= runnersUpThreshold ? "Finalist" : null;

return { ...submission, avgScore, winnerTag };
})
.sort((a, b) => b.avgScore - a.avgScore);

return (
<div className="max-w-7xl container mx-auto px-6">
<div className="max-w-7xl container mx-auto px-6 mt-10">
<h2 className="text-2xl font-bold mb-4">🏆 Prize Distribution</h2>
<ul className="list-disc list-inside ml-3">
<li className="text-lg">
<span className="font-bold">Winner:</span> $1000
</li>
<li className="text-lg">
<span className="font-bold">Finalist:</span> $500
</li>
</ul>

<div className="grid gap-6 md:grid-cols-2 xl:grid-cols-3 mt-6">
{submissions.length === 0 && (
<div role="alert" className="alert col-span-2">
Expand Down

0 comments on commit d17a5ad

Please sign in to comment.