Replace generic stat cards with clean horizontal stats strip
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m5s
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:
@@ -30,7 +30,6 @@ import {
|
|||||||
ClipboardList,
|
ClipboardList,
|
||||||
BarChart3,
|
BarChart3,
|
||||||
TrendingUp,
|
TrendingUp,
|
||||||
CheckCircle2,
|
|
||||||
Users,
|
Users,
|
||||||
Globe,
|
Globe,
|
||||||
ChevronRight,
|
ChevronRight,
|
||||||
@@ -201,79 +200,29 @@ export function ObserverDashboardContent({ userName }: { userName?: string }) {
|
|||||||
<p className="text-muted-foreground">Welcome, {userName || 'Observer'}</p>
|
<p className="text-muted-foreground">Welcome, {userName || 'Observer'}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Six Stat Tiles */}
|
{/* Stats Strip */}
|
||||||
{statsLoading ? (
|
{statsLoading ? (
|
||||||
<div className="grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-6">
|
<Card className="p-4">
|
||||||
{[...Array(6)].map((_, i) => (
|
<Skeleton className="h-10 w-full" />
|
||||||
<Card key={i} className="p-4">
|
</Card>
|
||||||
<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>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
) : stats ? (
|
) : stats ? (
|
||||||
<div className="grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-6">
|
<Card className="p-0 overflow-hidden">
|
||||||
<AnimatedCard index={0}>
|
<div className="grid grid-cols-3 md:grid-cols-6 divide-x divide-border">
|
||||||
<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">
|
{ value: stats.projectCount, label: 'Projects' },
|
||||||
<ClipboardList className="h-5 w-5 text-emerald-600" />
|
{ 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>
|
||||||
<p className="text-2xl font-bold tabular-nums">{stats.projectCount}</p>
|
))}
|
||||||
<p className="text-xs text-muted-foreground">Total Projects</p>
|
</div>
|
||||||
</Card>
|
</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}
|
) : null}
|
||||||
|
|
||||||
{/* Pipeline */}
|
{/* Pipeline */}
|
||||||
|
|||||||
Reference in New Issue
Block a user