import {
  Globe,
  ShoppingCart,
  Smartphone,
  Code2,
  Users,
  TrendingUp,
  Share2,
  Megaphone,
  Layers,
  type LucideIcon,
} from "lucide-react";

const iconMap: Record<string, LucideIcon> = {
  Globe,
  ShoppingCart,
  Smartphone,
  Code2,
  Users,
  TrendingUp,
  Share2,
  Megaphone,
  Layers,
};

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