1- import { Leaderboard } from "@/api/leaderboard" ;
2- import { Row } from "@tanstack/react-table" ;
3- import React from "react" ;
1+ import { type Leaderboard } from "@/api/leaderboard" ;
42import {
53 Dialog ,
64 DialogContent ,
@@ -9,70 +7,97 @@ import {
97 DialogTitle ,
108 DialogTrigger ,
119} from "@/components/ui/dialog" ;
12- import { Card , CardContent } from "./ui/card" ;
1310import { Label } from "@radix-ui/react-dropdown-menu" ;
11+ import { type Row } from "@tanstack/react-table" ;
12+ import {
13+ Brush ,
14+ Code ,
15+ LayoutList ,
16+ Presentation ,
17+ Trophy ,
18+ Users ,
19+ } from "lucide-react" ;
1420import { Button } from "./ui/button" ;
1521
1622export default function ViewScores ( { row } : { row : Row < Leaderboard > } ) {
1723 return (
1824 < Dialog >
1925 < DialogTrigger asChild >
20- < Button > View Scores</ Button >
26+ < Button variant = "outline" className = "flex items-center gap-2" >
27+ < Trophy className = "h-5 w-5" /> View Scores
28+ </ Button >
2129 </ DialogTrigger >
2230 < DialogContent >
2331 < DialogHeader >
24- < DialogTitle > Here are the scores: </ DialogTitle >
32+ < DialogTitle className = "mb-4 flex items-center gap-2" >
33+ < Trophy className = "h-6 w-6 text-yellow-500" /> Here are the scores:
34+ </ DialogTitle >
2535 < DialogDescription >
26- < Card >
27- < CardContent className = "overflow-y-auto space-y-2" >
28- < div >
29- < Label className = "font-semibold" > Team Name:</ Label > { " " }
30- { row . original . team_name }
31- </ div >
32- { row . original . rounds . map ( ( round , index ) => {
33- const {
34- design,
35- implementation,
36- innovation,
37- presentation,
38- teamwork,
39- round_total,
40- } = round ;
41- return (
42- < div
43- key = { index }
44- className = " border border-black p-2"
45- >
46- < div > Round { index } score: </ div >
47- < div >
48- < Label className = "font-semibold" > Design:</ Label > { " " }
49- { design }
36+ < div className = "mb-4 rounded-lg border border-gray-300 p-4" >
37+ < Label className = "text-lg font-semibold" > Team Name:</ Label > { " " }
38+ { row . original . team_name }
39+ </ div >
40+ < div className = "max-h-[65vh] overflow-auto" >
41+ { row . original . rounds . map ( ( round , index ) => {
42+ const {
43+ design,
44+ implementation,
45+ innovation,
46+ presentation,
47+ teamwork,
48+ round_total,
49+ } = round ;
50+ return (
51+ < div
52+ key = { index }
53+ className = "mb-4 rounded-lg border border-gray-400 p-4"
54+ >
55+ < div className = "flex items-center gap-2 text-lg font-semibold" >
56+ < LayoutList className = "h-5 w-5 text-blue-500" /> Round{ " " }
57+ { index + 1 } Scores:
58+ </ div >
59+ < div className = "mt-2 flex flex-col gap-2" >
60+ < div className = "flex items-center gap-2" >
61+ < Brush className = "h-4 w-4 text-purple-500" />
62+ < Label className = "font-semibold" >
63+ Design: { design }
64+ </ Label >
5065 </ div >
51- < div >
52- < Label className = "font-semibold" > Implementation:</ Label > { " " }
53- { implementation }
66+ < div className = "flex items-center gap-2" >
67+ < Code className = "h-4 w-4 text-green-500" />
68+ < Label className = "font-semibold" >
69+ Implementation: { implementation }
70+ </ Label >
5471 </ div >
55- < div >
56- < Label className = "font-semibold" > Innovation:</ Label > { " " }
57- { innovation }
72+ < div className = "flex items-center gap-2" >
73+ < Trophy className = "h-4 w-4 text-yellow-500" />
74+ < Label className = "font-semibold" >
75+ Innovation: { innovation }
76+ </ Label >
5877 </ div >
59- < div >
60- < Label className = "font-semibold" > Presentation:</ Label > { " " }
61- { presentation }
78+ < div className = "flex items-center gap-2" >
79+ < Presentation className = "h-4 w-4 text-red-500" />
80+ < Label className = "font-semibold" >
81+ Presentation: { presentation }
82+ </ Label >
6283 </ div >
63- < div >
64- < Label className = "font-semibold" > Teamwork:</ Label > { " " }
65- { teamwork }
84+ < div className = "flex items-center gap-2" >
85+ < Users className = "h-4 w-4 text-blue-700" />
86+ < Label className = "font-semibold" >
87+ Teamwork: { teamwork }
88+ </ Label >
6689 </ div >
67- < div >
68- < Label className = "font-semibold" > Total Score:</ Label > { " " }
69- { round_total }
90+ < div className = "mt-2 flex items-center gap-2 border-t pt-2" >
91+ < Trophy className = "h-5 w-5 text-orange-500" />
92+ < Label className = "text-lg font-semibold" >
93+ Total Score: { round_total }
94+ </ Label >
7095 </ div >
7196 </ div >
72- ) ;
73- } ) }
74- </ CardContent >
75- </ Card >
97+ </ div >
98+ ) ;
99+ } ) }
100+ </ div >
76101 </ DialogDescription >
77102 </ DialogHeader >
78103 </ DialogContent >
0 commit comments