Replace generic stat cards with clean horizontal stats strip
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m5s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-21 00:26:04 +01:00
parent 4f73ba5a0e
commit 533d8cb8e5

View File

@@ -30,7 +30,6 @@ import {
ClipboardList,
BarChart3,
TrendingUp,
CheckCircle2,
Users,
Globe,
ChevronRight,
@@ -201,79 +200,29 @@ export function ObserverDashboardContent({ userName }: { userName?: string }) {
<p className="text-muted-foreground">Welcome, {userName || 'Observer'}</p>
</div>
{/* Six Stat Tiles */}
{/* Stats Strip */}
{statsLoading ? (
<div className="grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-6">
{[...Array(6)].map((_, i) => (
<Card key={i} className="p-4">
<Skeleton className="h-8 w-8 rounded-lg mb-3" />
<Skeleton className="h-7 w-16 mb-1" />
<Skeleton className="h-3 w-20" />
<Card className="p-4">
<Skeleton className="h-10 w-full" />
</Card>
) : stats ? (
<Card className="p-0 overflow-hidden">
<div className="grid grid-cols-3 md:grid-cols-6 divide-x divide-border">
{[
{ value: stats.projectCount, label: 'Projects' },
{ value: stats.activeRoundCount, label: 'Active Rounds' },
{ value: avgScore, label: 'Avg Score' },
{ value: `${stats.completionRate}%`, label: 'Completion' },
{ value: stats.jurorCount, label: 'Jurors' },
{ value: countryCount, label: 'Countries' },
].map((stat) => (
<div key={stat.label} className="px-4 py-3.5 text-center">
<p className="text-xl font-semibold tabular-nums leading-tight">{stat.value}</p>
<p className="text-[11px] text-muted-foreground mt-0.5">{stat.label}</p>
</div>
))}
</div>
) : stats ? (
<div className="grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-6">
<AnimatedCard index={0}>
<Card className="group cursor-default p-4 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md">
<div className="mb-3 inline-flex rounded-lg bg-emerald-100 p-2">
<ClipboardList className="h-5 w-5 text-emerald-600" />
</div>
<p className="text-2xl font-bold tabular-nums">{stats.projectCount}</p>
<p className="text-xs text-muted-foreground">Total Projects</p>
</Card>
</AnimatedCard>
<AnimatedCard index={1}>
<Card className="group cursor-default p-4 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md">
<div className="mb-3 inline-flex rounded-lg bg-blue-100 p-2">
<BarChart3 className="h-5 w-5 text-blue-600" />
</div>
<p className="text-2xl font-bold tabular-nums">{stats.activeRoundCount}</p>
<p className="text-xs text-muted-foreground">Active Rounds</p>
</Card>
</AnimatedCard>
<AnimatedCard index={2}>
<Card className="group cursor-default p-4 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md">
<div className="mb-3 inline-flex rounded-lg bg-amber-100 p-2">
<TrendingUp className="h-5 w-5 text-amber-600" />
</div>
<p className="text-2xl font-bold tabular-nums">{avgScore}</p>
<p className="text-xs text-muted-foreground">Avg Score</p>
</Card>
</AnimatedCard>
<AnimatedCard index={3}>
<Card className="group cursor-default p-4 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md">
<div className="mb-3 inline-flex rounded-lg bg-teal-100 p-2">
<CheckCircle2 className="h-5 w-5 text-teal-600" />
</div>
<p className="text-2xl font-bold tabular-nums">{stats.completionRate}%</p>
<p className="text-xs text-muted-foreground">Completion</p>
</Card>
</AnimatedCard>
<AnimatedCard index={4}>
<Card className="group cursor-default p-4 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md">
<div className="mb-3 inline-flex rounded-lg bg-violet-100 p-2">
<Users className="h-5 w-5 text-violet-600" />
</div>
<p className="text-2xl font-bold tabular-nums">{stats.jurorCount}</p>
<p className="text-xs text-muted-foreground">Active Jurors</p>
</Card>
</AnimatedCard>
<AnimatedCard index={5}>
<Card className="group cursor-default p-4 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md">
<div className="mb-3 inline-flex rounded-lg bg-rose-100 p-2">
<Globe className="h-5 w-5 text-rose-600" />
</div>
<p className="text-2xl font-bold tabular-nums">{countryCount}</p>
<p className="text-xs text-muted-foreground">Countries</p>
</Card>
</AnimatedCard>
</div>
) : null}
{/* Pipeline */}