import type { ReactNode } from "react"; import MetricTooltip from "./MetricTooltip"; interface CoverageSummaryCardProps { title: string; value: number; total?: number; icon: ReactNode; colorClass: string; bgClass: string; /** Optional tooltip explaining this metric to non-technical users */ tooltip?: { description: string; context?: string }; } export default function CoverageSummaryCard({ title, value, total, icon, colorClass, bgClass, tooltip, }: CoverageSummaryCardProps) { const percentage = total && total > 0 ? ((value / total) * 100).toFixed(1) : null; return (

{title} {tooltip && ( )}

{value}

{percentage !== null && (

{percentage}% of total

)}
{icon}
); }