import {
  Bell,
  BookHeart,
  Calendar,
  Sprout,
  CalendarDays,
  CheckSquare,
  ChevronDown,
  ChevronLeft,
  ChevronRight,
  Circle,
  Clock,
  Eye,
  FileText,
  Filter,
  Globe,
  History,
  Home,
  Link as LinkIcon,
  ListChecks,
  Lock,
  Mail,
  Menu,
  MessageCircle,
  MoreHorizontal,
  Pencil,
  Phone,
  Pin,
  PinOff,
  Plus,
  Search,
  Settings,
  Share2,
  ShoppingCart,
  Sparkles,
  Sun,
  Trash2,
  Users,
  X,
} from "lucide-react";
import type { LucideProps } from "lucide-react";

const ICONS: Record<string, React.ComponentType<LucideProps>> = {
  home: Home,
  calendar: Calendar,
  "calendar-days": CalendarDays,
  list: ListChecks,
  "check-square": CheckSquare,
  "file-text": FileText,
  "book-heart": BookHeart,
  note: FileText,
  settings: Settings,
  history: History,
  link: LinkIcon,
  people: Users,
  users: Users,
  plus: Plus,
  search: Search,
  bell: Bell,
  pin: Pin,
  "pin-off": PinOff,
  cart: ShoppingCart,
  "shopping-cart": ShoppingCart,
  share: Share2,
  lock: Lock,
  eye: Eye,
  clock: Clock,
  sparkles: Sparkles,
  pencil: Pencil,
  trash: Trash2,
  globe: Globe,
  phone: Phone,
  filter: Filter,
  sun: Sun,
  sprout: Sprout,
  mail: Mail,
  menu: Menu,
  "message-circle": MessageCircle,
  more: MoreHorizontal,
  x: X,
  "chevron-left": ChevronLeft,
  "chevron-right": ChevronRight,
  "chevron-down": ChevronDown,
};

export function NavIcon({ name, ...rest }: { name: string } & LucideProps) {
  const Icon = ICONS[name] ?? Circle;
  return <Icon strokeWidth={1.6} {...rest} />;
}
