import React from 'react'; import type { ReactNode } from 'react'; interface StatCardProps { label: string; value: string | number; icon?: ReactNode; change?: number; unit?: string; } export default function StatCard({ label, value, icon, change, unit }: StatCardProps) { const isPositive = change && change > 0; const isNegative = change && change < 0; return (
{icon}
{change !== undefined && (
{isPositive ? '↑' : '↓'} {Math.abs(change)}%
)}

{label}

{value}

{unit && {unit}}
); }