import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; interface MetricCardProps { title: string; value: string | number | null; icon?: React.ComponentType>; description?: string; isLoading?: boolean; error?: string; } export function MetricCard({ title, value, icon: Icon, description, isLoading, error, }: MetricCardProps) { return ( {title}
{Icon && }
{isLoading ? ( ) : error ? (

{error}

) : ( <>
{typeof value === "number" ? value.toLocaleString() : (value ?? "-")}
{description && (

{description}

)} )}
); }