import * as React from "react";
import * as Icons from "lucide-react";
import type { LucideIcon } from "lucide-react";

export function Icon({
  name,
  className,
  fallback = "Circle",
}: {
  name?: string | null;
  className?: string;
  fallback?: string;
}) {
  const lib = Icons as unknown as Record<string, LucideIcon>;
  const Cmp = (name && lib[name]) || lib[fallback] || lib.Circle;
  return <Cmp className={className} />;
}
