import { memo } from "react"; import { Card } from "@/components/ui/card"; import type { LucideProps } from "lucide-react"; import type { ForwardRefExoticComponent, RefAttributes } from "react"; type LucideIcon = ForwardRefExoticComponent & RefAttributes>; interface KPICardProps { title: string; value: string | number; icon: LucideIcon; trend?: string; trendColor?: "success" | "danger" | "default"; } const getTrendColorClass = (trendColor: "success" | "danger" | "default"): string => { switch (trendColor) { case "success": return "text-success"; case "danger": return "text-danger"; default: return "text-muted-foreground"; } }; export const KPICard = memo(({ title, value, icon: Icon, trend, trendColor = "default" }: KPICardProps) => { return (

{title}

{value}

{trend &&

{trend}

}
); }); KPICard.displayName = 'KPICard';