From 6e5211d47882e514a5a589bb32c6af990dba6ecc Mon Sep 17 00:00:00 2001 From: Leo dev Date: Tue, 3 Feb 2026 00:01:24 +0100 Subject: [PATCH] hot live runs --- src/app/runs/page.tsx | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/app/runs/page.tsx b/src/app/runs/page.tsx index 809afaf..43da886 100644 --- a/src/app/runs/page.tsx +++ b/src/app/runs/page.tsx @@ -58,6 +58,13 @@ const liveRuns = [ /* ---------------- page ---------------- */ export default function LiveRuns() { + // Sort top runners (status === 'pb') to the top + const sortedRuns = [...liveRuns].sort((a, b) => { + if (a.status === "pb" && b.status !== "pb") return -1; + if (a.status !== "pb" && b.status === "pb") return 1; + return 0; + }); + return (
@@ -105,7 +112,7 @@ export default function LiveRuns() { - {liveRuns.map((run) => ( + {sortedRuns.map((run) => ( ))} @@ -116,20 +123,19 @@ export default function LiveRuns() { ); } -/* ---------------- row ---------------- */ - function LiveRunRow({ username, problem, category, time, pace, status }: any) { const pacePositive = pace.startsWith("+"); + const isTop = status === "pb"; return ( - {username} + + {isTop ? `🔥 ${username}` : username} +
@@ -140,7 +146,11 @@ function LiveRunRow({ username, problem, category, time, pace, status }: any) {
- {time} + + {time} + Live @@ -170,7 +180,7 @@ function LiveRunRow({ username, problem, category, time, pace, status }: any) { -