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) { -