Statcard
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
|||||||
} from "@/components/ui/pagination";
|
} from "@/components/ui/pagination";
|
||||||
|
|
||||||
import LeaderboardRow from "@/app/leaderboards/components/LeaderboardRow";
|
import LeaderboardRow from "@/app/leaderboards/components/LeaderboardRow";
|
||||||
|
import CenterStatCard from "@/components/app/CenterStatCard";
|
||||||
|
|
||||||
const globalLeaderboard = [
|
const globalLeaderboard = [
|
||||||
{
|
{
|
||||||
@@ -190,10 +191,14 @@ export default function Leaderboards() {
|
|||||||
|
|
||||||
{/* Stats */}
|
{/* Stats */}
|
||||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||||
<StatCard icon={Globe} label="Total Runners" value="12,453" />
|
<CenterStatCard icon={Globe} label="Total Runners" value="12,453" />
|
||||||
<StatCard icon={Trophy} label="World Record" value="2:34.21" />
|
<CenterStatCard icon={Trophy} label="World Record" value="2:34.21" />
|
||||||
<StatCard icon={TrendingUp} label="Runs This Week" value="847K" />
|
<CenterStatCard
|
||||||
<StatCard icon={Calendar} label="Until Reset" value="5d 12h" />
|
icon={TrendingUp}
|
||||||
|
label="Runs This Week"
|
||||||
|
value="847K"
|
||||||
|
/>
|
||||||
|
<CenterStatCard icon={Calendar} label="Until Reset" value="5d 12h" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tabs + Filters */}
|
{/* Tabs + Filters */}
|
||||||
@@ -269,25 +274,3 @@ export default function Leaderboards() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- helpers ---------- */
|
|
||||||
|
|
||||||
function StatCard({
|
|
||||||
icon: Icon,
|
|
||||||
label,
|
|
||||||
value,
|
|
||||||
}: {
|
|
||||||
icon: any;
|
|
||||||
label: string;
|
|
||||||
value: string;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<Card>
|
|
||||||
<CardHeader className="pb-2 text-center">
|
|
||||||
<Icon className="mx-auto h-5 w-5 text-primary" />
|
|
||||||
<CardTitle className="font-mono text-2xl">{value}</CardTitle>
|
|
||||||
<p className="text-xs text-muted-foreground">{label}</p>
|
|
||||||
</CardHeader>
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
} from "@/components/ui/table";
|
} from "@/components/ui/table";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import LiveRunRow from "./components/LiveRunNow";
|
import LiveRunRow from "./components/LiveRunNow";
|
||||||
import StatCard from "./components/StatCard";
|
import CenterStatCard from "@/components/app/CenterStatCard";
|
||||||
|
|
||||||
/* ---------------- mock data ---------------- */
|
/* ---------------- mock data ---------------- */
|
||||||
|
|
||||||
@@ -81,10 +81,10 @@ export default function LiveRuns() {
|
|||||||
|
|
||||||
{/* Stats */}
|
{/* Stats */}
|
||||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||||
<StatCard icon={Zap} label="Live Runs" value="42" />
|
<CenterStatCard icon={Zap} label="Live Runs" value="42" />
|
||||||
<StatCard icon={Users} label="Active Runners" value="39" />
|
<CenterStatCard icon={Users} label="Active Runners" value="39" />
|
||||||
<StatCard icon={Timer} label="Avg Runtime" value="1:47" />
|
<CenterStatCard icon={Timer} label="Avg Runtime" value="1:47" />
|
||||||
<StatCard icon={TrendingUp} label="PB Pace Runs" value="7" />
|
<CenterStatCard icon={TrendingUp} label="PB Pace Runs" value="7" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Filters */}
|
{/* Filters */}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Card, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
|
|
||||||
export default function StatCard({
|
export default function CenterStatCard({
|
||||||
icon: Icon,
|
icon: Icon,
|
||||||
label,
|
label,
|
||||||
value,
|
value,
|
||||||
Reference in New Issue
Block a user