'use client'; import { ReactNode } from 'react'; import { cn } from '@/lib/utils'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Skeleton } from '@/components/ui/skeleton'; interface PageStatsProps { children: ReactNode; className?: string; columns?: 2 | 3 | 4 | 5 | 6; } export function PageStats({ children, className, columns = 4 }: PageStatsProps) { const columnClasses = { 2: 'grid-cols-1 sm:grid-cols-2', 3: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3', 4: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-4', 5: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-5', 6: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6', }; return (
{children}
); } interface PageStatCardProps { title: string; value: string | number; icon?: ReactNode; description?: string; loading?: boolean; trend?: { value: number; label: string; positive?: boolean; }; className?: string; } export function PageStatCard({ title, value, icon, description, loading, trend, className, }: PageStatCardProps) { return ( {title} {icon &&
{icon}
}
{loading ? ( ) : (
{value}
)} {description && (

{description}

)} {trend && (

{trend.positive ? '↑' : '↓'} {Math.abs(trend.value)}% {' '}{trend.label}

)}
); } export default PageStats;