Spaces:
Running

File size: 2,454 Bytes
cd61bf7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720d442
 
 
 
 
cd61bf7
 
 
 
 
 
dc7e33a
cd61bf7
 
 
720d442
 
cd61bf7
 
720d442
 
cd61bf7
 
 
 
720d442
 
 
cd61bf7
 
 
 
720d442
cd61bf7
 
 
720d442
cd61bf7
 
720d442
 
cd61bf7
720d442
cd61bf7
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'use client'

import { LucideIcon } from 'lucide-react'
import { cn } from '@/lib/utils'

interface StatsCardProps {
  title: string
  value: string | number
  icon: LucideIcon
  trend?: {
    value: number
    isPositive: boolean
  }
  className?: string
  iconColor?: string
  iconBgColor?: string
}

export function StatsCard({
  title,
  value,
  icon: Icon,
  trend,
  className,
  iconColor = 'text-blue-600',
  iconBgColor = 'bg-blue-50'
}: StatsCardProps) {
  return (
    <div className={cn(
      "group relative bg-surface-elevated rounded-2xl border border-white/10 p-6 transition-all duration-300 hover:border-indigo-500/30 hover:-translate-y-0.5 hover:shadow-[0_0_30px_-5px_rgba(99,102,241,0.15)]",
      className
    )}>
      {/* Premium gradient overlay */}
      <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/0 via-purple-500/0 to-pink-500/0 group-hover:from-indigo-500/5 group-hover:via-purple-500/3 group-hover:to-pink-500/5 transition-all duration-500 rounded-2xl" />

      <div className="relative flex items-start justify-between">
        <div className="flex-1">
          <p className="text-xs font-semibold text-slate-400 uppercase tracking-wider mb-2">{title}</p>
          <p className="text-4xl font-bold text-white tracking-tight">{value}</p>
          {trend && (
            <div className="flex items-center gap-2 mt-4">
              <div className={cn(
                "flex items-center gap-1 text-xs font-bold px-2.5 py-1 rounded-lg",
                trend.isPositive
                  ? "bg-emerald-500/20 text-emerald-400 ring-1 ring-emerald-500/30"
                  : "bg-red-500/20 text-red-400 ring-1 ring-red-500/30"
              )}>
                <span>{trend.isPositive ? '↑' : '↓'}</span>
                <span>{Math.abs(trend.value)}%</span>
              </div>
              <span className="text-xs text-slate-500 font-medium">по сравнению с прошлым месяцем</span>
            </div>
          )}
        </div>

        {/* Icon with modern styling */}
        <div className={cn(
          "p-3.5 rounded-xl transition-all duration-300 group-hover:scale-110 border border-white/10",
          iconBgColor.replace('bg-blue-50', 'bg-indigo-500/20').replace('bg-', 'bg-')
        )}>
          <Icon className={cn("w-5 h-5", iconColor.replace('text-blue-600', 'text-indigo-400'))} strokeWidth={2.5} />
        </div>
      </div>
    </div>
  )
}