import React from 'react';
import * as Icons from 'lucide-react';

interface IconRendererProps {
  name: string;
  className?: string;
  size?: number;
}

export const IconRenderer: React.FC<IconRendererProps> = ({
  name,
  className = "w-6 h-6",
  size = 24
}) => {
  // Map custom string names to Lucide icons
  const iconMap: Record<string, React.ElementType> = {
    Stethoscope: Icons.Stethoscope,
    Activity: Icons.Activity,
    Users: Icons.Users,
    ShieldCheck: Icons.ShieldCheck,
    HeartPulse: Icons.HeartPulse,
    UserCheck: Icons.UserCheck,
    Scissors: Icons.Scissors,
    ClipboardList: Icons.ClipboardList,
    FileText: Icons.FileText,
    RefreshCw: Icons.RefreshCw,
    Award: Icons.Award,
    Heart: Icons.Heart,
    Building2: Icons.Building2,
    Smile: Icons.Smile,
    Sparkles: Icons.Sparkles,
    Phone: Icons.Phone,
    MapPin: Icons.MapPin,
    Clock: Icons.Clock,
    Calendar: Icons.Calendar,
    CheckCircle2: Icons.CheckCircle2,
    ArrowRight: Icons.ArrowRight,
    Star: Icons.Star,
    HelpCircle: Icons.HelpCircle,
    AlertCircle: Icons.AlertCircle,
    ChevronDown: Icons.ChevronDown,
    Plus: Icons.Plus,
    Check: Icons.Check,
    Search: Icons.Search,
    Mail: Icons.Mail,
    Globe: Icons.Globe,
    ExternalLink: Icons.ExternalLink,
    X: Icons.X,
    Menu: Icons.Menu,
    MessageSquare: Icons.MessageSquare,
    UserPlus: Icons.UserPlus,
    Syringe: Icons.Syringe,
    Pill: Icons.Pill
  };

  const IconComponent = iconMap[name] || Icons.HelpCircle;
  return <IconComponent className={className} size={size} />;
};
