2026-02-05 15:28:50 +01:00
|
|
|
interface StatCardProps {
|
|
|
|
|
label: string
|
|
|
|
|
value: number
|
2026-02-16 20:39:41 +01:00
|
|
|
total?: number | undefined
|
2026-02-05 15:28:50 +01:00
|
|
|
color: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const colorClasses: Record<string, string> = {
|
|
|
|
|
blue: 'border-blue-500',
|
|
|
|
|
green: 'border-green-500',
|
|
|
|
|
red: 'border-red-500',
|
|
|
|
|
purple: 'border-purple-500',
|
|
|
|
|
amber: 'border-amber-500',
|
|
|
|
|
gray: 'border-gray-500',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function StatCard({ label, value, total, color }: StatCardProps) {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
className={`bg-white dark:bg-gray-800 rounded-lg shadow p-4 border-l-4 ${colorClasses[color] ?? 'border-gray-500'}`}
|
|
|
|
|
>
|
|
|
|
|
<div className="text-2xl font-bold text-gray-900 dark:text-gray-100">
|
|
|
|
|
{value}
|
|
|
|
|
{total !== undefined && (
|
2026-02-16 20:39:41 +01:00
|
|
|
<span className="text-sm font-normal text-gray-500 dark:text-gray-400"> / {total}</span>
|
2026-02-05 15:28:50 +01:00
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<div className="text-sm text-gray-600 dark:text-gray-400">{label}</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|