StatsCard.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. "use client"
  2. import { LucideIcon } from "lucide-react"
  3. import { Card, CardContent } from "@/components/ui/card"
  4. interface StatsCardProps {
  5. title: string
  6. value: string | number
  7. icon: LucideIcon
  8. description?: string
  9. color?: "blue" | "green" | "purple" | "orange" | "pink"
  10. }
  11. const colorClasses = {
  12. blue: "bg-blue-100 text-blue-600",
  13. green: "bg-green-100 text-green-600",
  14. purple: "bg-purple-100 text-purple-600",
  15. orange: "bg-orange-100 text-orange-600",
  16. pink: "bg-pink-100 text-pink-600",
  17. }
  18. export function StatsCard({
  19. title,
  20. value,
  21. icon: Icon,
  22. description,
  23. color = "blue",
  24. }: StatsCardProps) {
  25. return (
  26. <Card>
  27. <CardContent className="p-6">
  28. <div className="flex items-center justify-between">
  29. <div className="flex-1">
  30. <p className="text-sm font-medium text-gray-600 mb-1">{title}</p>
  31. <p className="text-3xl font-bold text-gray-900">{value}</p>
  32. {description && (
  33. <p className="text-xs text-gray-500 mt-1">{description}</p>
  34. )}
  35. </div>
  36. <div
  37. className={`w-12 h-12 rounded-lg flex items-center justify-center ${colorClasses[color]}`}
  38. >
  39. <Icon className="w-6 h-6" />
  40. </div>
  41. </div>
  42. </CardContent>
  43. </Card>
  44. )
  45. }