content/components/stats/stats-01.tsx
import { Card, CardContent } from '@/components/ui/card';
import { cn } from '@/lib/utils';
const data = [
{
name: 'Profit',
value: '$287,654.00',
change: '+8.32%',
changeType: 'positive',
},
{
name: 'Late payments',
value: '$9,435.00',
change: '-12.64%',
changeType: 'negative',
},
{
name: 'Pending orders',
value: '$173,229.00',
change: '+2.87%',
changeType: 'positive',
},
{
name: 'Operating costs',
value: '$52,891.00',
change: '-5.73%',
changeType: 'negative',
},
];
export default function Stats01() {
return (
<div className="flex items-center justify-center p-10">
<div className="mx-auto grid grid-cols-1 gap-px rounded-xl bg-border sm:grid-cols-2 lg:grid-cols-4">
{data.map((stat, index) => (
<Card
className={cn(
'rounded-none border-0 py-0 shadow-none',
index === 0 && 'rounded-l-xl',
index === data.length - 1 && 'rounded-r-xl'
)}
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-green-800 dark:text-green-400'
: 'text-red-800 dark:text-red-400'
)}
>
{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>
);
}


























