import React from 'react'; import { LucideIcon } from 'lucide-react'; interface KPICardProps { title: string; value: string | number; subValue?: string; trend?: 'up' | 'down' | 'neutral'; trendValue?: string; icon: LucideIcon; colorClass?: string; } export const KPICard: React.FC = ({ title, value, subValue, trend, trendValue, icon: Icon, colorClass = "text-blue-600" }) => { // Extract base color from colorClass (e.g., 'text-brand-yellow' -> 'brand-yellow' or 'text-blue-600' -> 'blue-600') // Safer extraction: const baseColor = colorClass.replace('text-', '').split(' ')[0]; // gets 'brand-yellow' or 'zinc-500' return (

{title}

{value}
{(trend || subValue) && (
{trend === 'up' && ▲ {trendValue}} {trend === 'down' && ▼ {trendValue}} {trend === 'neutral' && - {trendValue}} {subValue && {subValue}}
)}
); };