From 2f55f3b3fb2069fedd526f56b8fd6f1e3fcd264d Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sat, 7 Feb 2026 22:15:41 +0100 Subject: [PATCH] improved live run row --- src/app/runs/components/LiveRunRow.tsx | 40 ++++++-------------------- src/app/runs/page.tsx | 15 ++++------ 2 files changed, 13 insertions(+), 42 deletions(-) diff --git a/src/app/runs/components/LiveRunRow.tsx b/src/app/runs/components/LiveRunRow.tsx index 716a8d4..03b8a3b 100644 --- a/src/app/runs/components/LiveRunRow.tsx +++ b/src/app/runs/components/LiveRunRow.tsx @@ -1,8 +1,6 @@ "use client"; -import { Eye } from "lucide-react"; import { Badge } from "@/components/ui/badge"; -import { Button } from "@/components/ui/button"; import { TableRow, TableCell } from "@/components/ui/table"; import { cn } from "@/lib/utils"; import { LiveRun } from "@/modules/live-run/types"; @@ -29,48 +27,26 @@ export default function LiveRunRow({ animationFillMode: "forwards", }} > - + {/* Runner */} + {isTop ? `🔥 ${run.username}` : run.username} - -
- {run.problem} - - {run.category} - -
-
+ {/* Problem + Category */} + {run.problem} + {/* Runtime */} {formatTime(now - run.start, false)} + {/* Views */} {isTop ? {run.views} : run.views} - -
- - Live -
-
- - - - + {/* Live status with category color */} + {run.category} ); } diff --git a/src/app/runs/page.tsx b/src/app/runs/page.tsx index a0038f1..3e9a71d 100644 --- a/src/app/runs/page.tsx +++ b/src/app/runs/page.tsx @@ -1,16 +1,12 @@ "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 { Card } from "@/components/ui/card"; import { Table, TableBody, TableHead, TableHeader, TableRow, - TableCell, } from "@/components/ui/table"; import LiveRunRow from "./components/LiveRunRow"; import useAction from "@/hook/use-action"; @@ -18,7 +14,7 @@ import { getLiveRuns } from "@/modules/live-run/actions"; import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; export default function LiveRuns() { - const [liveRuns, liveRunsLoaded, liveRunsError] = useAction(getLiveRuns); + const [liveRuns] = useAction(getLiveRuns); // Sort top runners (status === 'pb') to the top const sortedRuns = [...(liveRuns || [])]; @@ -53,10 +49,9 @@ export default function LiveRuns() { Runner Problem - Time - Views - Status - + Time + Views + Category