From 3486f9a6136e60ad5ac57f32c6c299fdeafd5257 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Mon, 2 Feb 2026 23:36:16 +0100 Subject: [PATCH] runs page --- src/app/runs/page.tsx | 202 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 src/app/runs/page.tsx diff --git a/src/app/runs/page.tsx b/src/app/runs/page.tsx new file mode 100644 index 0000000..809afaf --- /dev/null +++ b/src/app/runs/page.tsx @@ -0,0 +1,202 @@ +"use client"; + +import { Zap, Users, Timer, TrendingUp, Eye } from "lucide-react"; + +import { Card, CardHeader, CardTitle } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { + Table, + TableBody, + TableHead, + TableHeader, + TableRow, + TableCell, +} from "@/components/ui/table"; + +/* ---------------- mock data ---------------- */ + +const liveRuns = [ + { + id: 1, + username: "speedmaster_x", + problem: "Two Sum Dash", + category: "Any%", + time: "1:52.34", + pace: "-0:03", + status: "pb", + }, + { + id: 2, + username: "algo_ninja", + problem: "Binary Sprint", + category: "Any%", + time: "2:04.11", + pace: "+0:05", + status: "normal", + }, + { + id: 3, + username: "stackattack", + problem: "String Scramble", + category: "Easy", + time: "0:48.92", + pace: "-0:01", + status: "pb", + }, + { + id: 4, + username: "reset_king", + problem: "Linked List Rush", + category: "Any%", + time: "1:31.77", + pace: "+0:12", + status: "danger", + }, +]; + +/* ---------------- page ---------------- */ + +export default function LiveRuns() { + return ( +
+
+ {/* Header */} +
+

Live Runs

+

+ Watch runners compete in real time. Every second counts. +

+
+ + {/* Stats */} +
+ + + + +
+ + {/* Filters */} +
+ {["Any%", "100%", "Easy", "Hard"].map((cat) => ( + + {cat} + + ))} + + + 🔥 PB Pace + +
+ + {/* Table */} + + + + + Runner + Problem + Time + Pace + Status + + + + + + {liveRuns.map((run) => ( + + ))} + +
+
+
+
+ ); +} + +/* ---------------- row ---------------- */ + +function LiveRunRow({ username, problem, category, time, pace, status }: any) { + const pacePositive = pace.startsWith("+"); + + return ( + + {username} + + +
+ {problem} + + {category} + +
+
+ + {time} + + + + {pace} + + + + +
+ + Live +
+
+ + + + +
+ ); +} + +/* ---------------- helpers ---------------- */ + +function StatCard({ + icon: Icon, + label, + value, +}: { + icon: any; + label: string; + value: string; +}) { + return ( + + + + {value} +

{label}

+
+
+ ); +}