import * as React from 'react' import { TrendingUp, TrendingDown, Minus } from 'lucide-react' import { cn } from '../../utils/cn' export interface StatsCardChange { value: number trend: 'up' | 'down' | 'neutral' label?: string } export interface StatsCardProps { title: string value: string | number change?: StatsCardChange icon?: React.ReactNode href?: string className?: string } /** * StatsCard - KPI/metric card component * * Features: * - Trend indicators with TrendingUp/TrendingDown/Minus icons * - Color-coded trends (success for up, error for down, muted for neutral) * - Interactive hover state when href is provided * - Card styles (rounded-xl, border, shadow on hover) */ export function StatsCard({ title, value, change, icon, href, className, }: StatsCardProps) { const isInteractive = Boolean(href) const TrendIcon = change?.trend === 'up' ? TrendingUp : change?.trend === 'down' ? TrendingDown : Minus const trendColorClass = change?.trend === 'up' ? 'text-success' : change?.trend === 'down' ? 'text-error' : 'text-content-muted' const content = ( <>
{title}
{value}
{change && (