import {
  Globe,
  ShoppingCart,
  Smartphone,
  Code2,
  Users,
  TrendingUp,
  Share2,
  Megaphone,
  Layers,
  Star,
  Briefcase,
  Clock,
  Shield,
  Zap,
  Award,
  Headphones,
  CheckCircle2,
  Sparkles,
  Target,
  Rocket,
  Lock,
  type LucideIcon,
} from "lucide-react";

const iconMap: Record<string, LucideIcon> = {
  Globe,
  ShoppingCart,
  Smartphone,
  Code2,
  Users,
  TrendingUp,
  Share2,
  Megaphone,
  Layers,
  Star,
  Briefcase,
  Clock,
  Shield,
  Zap,
  Award,
  Headphones,
  CheckCircle2,
  Sparkles,
  Target,
  Rocket,
  Lock,
};

export const ICON_NAMES = Object.keys(iconMap);

export function Icon({
  name,
  className,
}: {
  name?: string | null;
  className?: string;
}) {
  const Cmp = (name && iconMap[name]) || Layers;
  return <Cmp className={className} />;
}
