From 8ee9295b4e47632d3ad70929d066589d0cfdbb52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20F=C3=B6rtsch?= Date: Thu, 12 Mar 2026 20:28:35 +0100 Subject: [PATCH] add jury display component Co-Authored-By: Claude Opus 4.6 --- .../client/src/components/jury-display.tsx | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 packages/client/src/components/jury-display.tsx diff --git a/packages/client/src/components/jury-display.tsx b/packages/client/src/components/jury-display.tsx new file mode 100644 index 0000000..8b07f19 --- /dev/null +++ b/packages/client/src/components/jury-display.tsx @@ -0,0 +1,73 @@ +import type { JuryRound, JuryResult } from "@celebrate-esc/shared" + +interface JuryDisplayProps { + currentRound: JuryRound | null + results: JuryResult[] +} + +export function JuryDisplay({ currentRound, results }: JuryDisplayProps) { + if (currentRound) { + return ( +
+

Now voting

+
+ {currentRound.countryFlag} +

{currentRound.countryName}

+
+

Rate 1-12 on your phone

+
+ ) + } + + if (results.length > 0) { + const lastResult = results[results.length - 1]! + const topRated = [...results].sort((a, b) => b.averageRating - a.averageRating)[0]! + return ( +
+
+

Latest result

+ {lastResult.countryFlag} +

{lastResult.countryName}

+

{lastResult.averageRating}

+

{lastResult.totalVotes} votes

+
+ + {results.length > 1 && ( +
+

+ And 12 points go to... +

+

+ {topRated.countryFlag} {topRated.countryName} +

+

+ {topRated.averageRating} avg +

+
+ )} + +
+

Rankings

+ {[...results] + .sort((a, b) => b.averageRating - a.averageRating) + .map((r, i) => ( +
+ + {i + 1} + {r.countryFlag} {r.countryName} + + {r.averageRating} +
+ ))} +
+
+ ) + } + + return ( +
+

Live Event

+

Waiting for host to open voting...

+
+ ) +}