'use client';
import { Card, CardContent } from '@/components/ui/card';
import { cn } from '@/lib/utils';
const data = [
{
name: 'Messages delivered',
value: '4,812,390',
change: '+6.4%',
changeType: 'positive',
},
{
name: 'Hard bounces',
value: '18,204',
change: '-3.1%',
changeType: 'negative',
},
{
name: 'Webhook events',
value: '1,297,518',
change: '+2.2%',
changeType: 'positive',
},
{
name: 'Spam complaints',
value: '412',
change: '-0.8%',
changeType: 'negative',
},
];
/**
* Joined KPI strip with percentage deltas.
*/
export default function Stats01() {
return (
<div className="w-full max-w-5xl px-4">
<div className="mx-auto grid grid-cols-1 gap-px overflow-hidden rounded-xl border border-border bg-border sm:grid-cols-2 lg:grid-cols-4">
{data.map((stat) => (
<Card
className="rounded-none border-0 py-0 shadow-none"
key={stat.name}
>
<CardContent className="flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2 p-4 sm:p-6">
<div className="font-medium text-muted-foreground text-sm">
{stat.name}
</div>
<div
className={cn(
'font-medium text-xs tabular-nums',
stat.changeType === 'positive'
? 'text-primary'
: 'text-destructive'
)}
>
{stat.change}
</div>
<div className="w-full flex-none font-medium text-3xl text-foreground tabular-nums tracking-tight">
{stat.value}
</div>
</CardContent>
</Card>
))}
</div>
</div>
);
}