diff --git a/src/app/runs/components/LiveRunRow.tsx b/src/app/runs/components/LiveRunRow.tsx index 6790689..716a8d4 100644 --- a/src/app/runs/components/LiveRunRow.tsx +++ b/src/app/runs/components/LiveRunRow.tsx @@ -16,7 +16,7 @@ export default function LiveRunRow({ run: LiveRun; }) { const now = new Date().getTime() + 1000; - const isTop = false; + const isTop = run.views > 5; return ( - - - 0 - - + {isTop ? {run.views} : run.views}
diff --git a/src/app/runs/page.tsx b/src/app/runs/page.tsx index 6af1023..a0038f1 100644 --- a/src/app/runs/page.tsx +++ b/src/app/runs/page.tsx @@ -4,7 +4,6 @@ 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, @@ -13,9 +12,7 @@ import { TableRow, TableCell, } from "@/components/ui/table"; -import { cn } from "@/lib/utils"; import LiveRunRow from "./components/LiveRunRow"; -import StatCard from "@/components/app/StatCard"; import useAction from "@/hook/use-action"; import { getLiveRuns } from "@/modules/live-run/actions"; import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; @@ -33,23 +30,10 @@ export default function LiveRuns() {

Live Runs

- Watch runners compete in real time. Every second counts. + 42 live runs ยท Streaming in real time

- {/* Stats */} -
- - - - -
- {/* Filters */}
@@ -70,7 +54,7 @@ export default function LiveRuns() { Runner Problem Time - Pace + Views Status diff --git a/src/modules/live-run/actions.ts b/src/modules/live-run/actions.ts index 9b4ebd2..7530f2b 100644 --- a/src/modules/live-run/actions.ts +++ b/src/modules/live-run/actions.ts @@ -16,12 +16,14 @@ export async function getLiveRuns(): Promise { username: "speedmaster_x", problem: "Two Sum Dash", category: "any%", + views: 670, runsCount: 1, start: new Date().getTime(), }, { id: "2", username: "algo_ninja", + views: 3, problem: "Binary Sprint", category: "any%", runsCount: 1, @@ -30,6 +32,7 @@ export async function getLiveRuns(): Promise { { id: "3", username: "stackattack", + views: 3, problem: "String Scramble", category: "any%", runsCount: 1, @@ -38,6 +41,7 @@ export async function getLiveRuns(): Promise { { id: "4", username: "reset_king", + views: 3, problem: "Linked List Rush", category: "any%", runsCount: 1, @@ -51,6 +55,7 @@ export async function getLiveRun(): Promise { id: "0", username: "selimaj", start: new Date().getTime(), + views: 230, problem: "solve", category: "any%", runsCount: 0, diff --git a/src/modules/live-run/types.ts b/src/modules/live-run/types.ts index 97154f4..f4073a4 100644 --- a/src/modules/live-run/types.ts +++ b/src/modules/live-run/types.ts @@ -1,6 +1,7 @@ export interface LiveRun { id: string; username: string; + views: number; start: number; runsCount: number; problem: string;