import type { ReactNode } from "react"; import { Link } from "react-router-dom"; export function KpiCard({ label, value, sub, tone, to, }: { label: string; value: ReactNode; sub?: ReactNode; tone?: "red" | "amber" | "blue"; to?: string; }) { const body = ( <> {label} {value} {sub ? {sub} : null} ); const className = `kpi-card${tone ? ` tone-${tone}` : ""}`; if (to) { return ( {body} ); } return
{body}
; }