import { LucideIcon } from "lucide-react"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; interface StatsCardProps { title: string; value: string | number; change?: string; trend?: "up" | "down" | "neutral"; icon: LucideIcon; color?: "blue" | "green" | "purple" | "orange"; } export function StatsCard({ title, value, change, trend, icon: Icon, color = "blue" }: StatsCardProps) { const colorStyles = { blue: { bg: "from-blue-600 to-blue-700", text: "text-white", light: "from-blue-600 to-blue-700", badge: "bg-blue-400 text-white", icon: "bg-white/20 text-white", }, green: { bg: "from-emerald-600 to-emerald-700", text: "text-white", light: "from-emerald-600 to-emerald-700", badge: "bg-emerald-400 text-white", icon: "bg-white/20 text-white", }, purple: { bg: "from-purple-600 to-purple-700", text: "text-white", light: "from-purple-600 to-purple-700", badge: "bg-purple-400 text-white", icon: "bg-white/20 text-white", }, orange: { bg: "from-orange-600 to-orange-700", text: "text-white", light: "from-orange-600 to-orange-700", badge: "bg-orange-400 text-white", icon: "bg-white/20 text-white", }, }; const styles = colorStyles[color]; return ( {title}
{value}
{change && (
{trend === "up" ? "↑" : trend === "down" ? "↓" : "→"} {change} vs month
)}
); }