diff --git a/src/components/app/LeaderboardRow.tsx b/src/app/leaderboards/components/LeaderboardRow.tsx similarity index 100% rename from src/components/app/LeaderboardRow.tsx rename to src/app/leaderboards/components/LeaderboardRow.tsx diff --git a/src/app/leaderboards/page.tsx b/src/app/leaderboards/page.tsx index 1d9f1ad..dc1aff7 100644 --- a/src/app/leaderboards/page.tsx +++ b/src/app/leaderboards/page.tsx @@ -23,7 +23,7 @@ import { PaginationPrevious, } from "@/components/ui/pagination"; -import LeaderboardRow from "@/components/app/LeaderboardRow"; +import LeaderboardRow from "@/app/leaderboards/components/LeaderboardRow"; const globalLeaderboard = [ { diff --git a/src/app/runs/components/LiveRunNow.tsx b/src/app/runs/components/LiveRunNow.tsx new file mode 100644 index 0000000..13e9919 --- /dev/null +++ b/src/app/runs/components/LiveRunNow.tsx @@ -0,0 +1,86 @@ +"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"; + +export default function LiveRunRow({ + index, + username, + problem, + category, + time, + pace, + status, +}: any) { + const pacePositive = pace.startsWith("+"); + const isTop = status === "pb"; + + return ( + + + {isTop ? `🔥 ${username}` : username} + + + + + {problem} + + {category} + + + + + + {time} + + + + + {pace} + + + + + + + Live + + + + + + + Watch + + + + ); +} diff --git a/src/app/runs/components/StatCard.tsx b/src/app/runs/components/StatCard.tsx new file mode 100644 index 0000000..963e918 --- /dev/null +++ b/src/app/runs/components/StatCard.tsx @@ -0,0 +1,21 @@ +import { Card, CardHeader, CardTitle } from "@/components/ui/card"; + +export default function StatCard({ + icon: Icon, + label, + value, +}: { + icon: any; + label: string; + value: string; +}) { + return ( + + + + {value} + {label} + + + ); +} diff --git a/src/app/runs/page.tsx b/src/app/runs/page.tsx index 715bf28..6b91ca2 100644 --- a/src/app/runs/page.tsx +++ b/src/app/runs/page.tsx @@ -14,6 +14,8 @@ import { TableCell, } from "@/components/ui/table"; import { cn } from "@/lib/utils"; +import LiveRunRow from "./components/LiveRunNow"; +import StatCard from "./components/StatCard"; /* ---------------- mock data ---------------- */ @@ -121,104 +123,3 @@ export default function LiveRuns() { ); } - -function LiveRunRow({ - index, - username, - problem, - category, - time, - pace, - status, -}: any) { - const pacePositive = pace.startsWith("+"); - const isTop = status === "pb"; - - return ( - - - {isTop ? `🔥 ${username}` : username} - - - - - {problem} - - {category} - - - - - - {time} - - - - - {pace} - - - - - - - Live - - - - - - - Watch - - - - ); -} - -/* ---------------- helpers ---------------- */ - -function StatCard({ - icon: Icon, - label, - value, -}: { - icon: any; - label: string; - value: string; -}) { - return ( - - - - {value} - {label} - - - ); -}
{label}