import React from 'react'; import { clsx } from 'clsx'; import { ArrowUp, ArrowDown } from 'lucide-react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card'; export interface StatCardProps { title: string; value: string | number; icon: React.ReactNode; subtext?: string; trend?: { value: number; label: string; isPositive?: boolean; }; onClick?: () => void; color?: 'primary' | 'success' | 'warning' | 'info' | 'default'; className?: string; } const colorClasses = { primary: 'bg-primary/10 text-primary border-primary/20', success: 'bg-success/10 text-success border-success/20', warning: 'bg-warning/10 text-warning border-warning/20', info: 'bg-primary/10 text-primary border-primary/20', default: 'bg-muted text-muted-foreground border-border', }; /** * Enhanced stat card component for dashboard metrics */ export const StatCard = ({ title, value, icon, subtext, trend, onClick, color = 'default', className, }: StatCardProps) => { const handleClick = () => { if (onClick) { onClick(); } }; return ( {title}
{icon}
{value}
{subtext &&

{subtext}

} {trend && (
{trend.isPositive !== false ? ( ) : ( )} {trend.value > 0 ? '+' : ''} {trend.value}% {trend.label}
)}
); };