import type { ReactNode } from "react"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import Card from "./Card"; export type StatCardColor = | "default" | "primary" | "success" | "warning" | "error" | "info"; export interface StatCardProps { label: string; value: ReactNode; icon?: ReactNode; color?: StatCardColor; footer?: ReactNode; } /** * KPI / metric tile. Dense Soft-SaaS look: tinted icon square, big value, * small uppercase label, optional footer caption. */ export default function StatCard({ label, value, icon, color = "default", footer, }: StatCardProps) { // Solid tile + white glyph: high-contrast in both themes (the old light tint // left the icon dark/low-visibility, esp. for the default variant). const iconBg = color === "default" ? "grey.600" : `${color}.main`; const iconColor = "common.white"; return ( {icon && ( {icon} )} {value} {label} {footer && ( {footer} )} ); }