// THIS FILE IS AUTO-GENERATED - DO NOT EDIT MANUALLY
// Generated by scripts/generate-icon-imports.js from tools_metadata.json

import React, { createElement } from 'react';
import * as LucideIcons from 'lucide-react';
import {
  FaDiscord,
  FaSlack,
  FaTelegram,
  FaPhone,
  FaVideo,
  FaWhatsapp,
  FaCog,
  FaCode,
  FaAws,
  FaCalendarAlt,
  FaImage,
  FaTerminal,
  FaDocker,
  FaDropbox,
  FaVolumeUp,
  FaRobot,
  FaFolder,
  FaGoogle,
  FaGithub,
  FaGitlab,
  FaMapMarkedAlt,
  FaTicketAlt,
  FaPython,
  FaGlobe,
  FaMicrosoft,
  FaYahoo,
  FaApple,
  FaSpotify,
  FaYoutube,
  FaGoodreads,
  FaConnectdevelop,
  FaFileCsv,
  FaTasks,
  FaChartLine,
  FaSpider,
  FaFileAlt,
  FaChrome,
  FaSearch,
  FaHackerNews,
  FaNewspaper,
  FaStethoscope,
  FaWikipediaW,
  FaAmazon,
  FaEbay,
  FaFacebook,
  FaInstagram,
  FaLinkedin,
  FaReddit,
  FaTwitter,
} from 'react-icons/fa';
import { FaConfluence } from 'react-icons/fa6';
import { SiOpenai, SiTrello, SiHbo, SiNetflix, SiTarget, SiWalmart } from 'react-icons/si';

// Map of all icons we use
const iconMap: Record<string, any> = {
  FaDiscord,
  FaSlack,
  FaTelegram,
  FaPhone,
  FaVideo,
  FaWhatsapp,
  FaCog,
  FaCode,
  FaAws,
  FaCalendarAlt,
  FaImage,
  FaTerminal,
  FaDocker,
  FaDropbox,
  FaVolumeUp,
  FaRobot,
  FaFolder,
  FaGoogle,
  FaGithub,
  FaGitlab,
  FaMapMarkedAlt,
  FaTicketAlt,
  FaPython,
  FaGlobe,
  FaMicrosoft,
  FaYahoo,
  FaApple,
  FaSpotify,
  FaYoutube,
  FaGoodreads,
  FaConnectdevelop,
  FaFileCsv,
  FaTasks,
  FaChartLine,
  FaSpider,
  FaFileAlt,
  FaChrome,
  FaSearch,
  FaHackerNews,
  FaNewspaper,
  FaStethoscope,
  FaWikipediaW,
  FaAmazon,
  FaEbay,
  FaFacebook,
  FaInstagram,
  FaLinkedin,
  FaReddit,
  FaTwitter,
  FaConfluence,
  FaLinear: LucideIcons.ListTodo, // Fallback icon
  SiOpenai,
  SiTrello,
  SiHbo,
  SiNetflix,
  SiTarget,
  SiWalmart,
  GiGift: LucideIcons.Gift, // Fallback icon
};

/**
 * Get the appropriate icon for a tool
 * @param iconName - The icon name from backend (e.g., "FaGithub", "Calculator", "Globe")
 * @param iconColor - The color class from backend (e.g., "text-blue-500")
 * @returns React element of the icon or default Globe icon
 */
export function getIconForTool(
  iconName: string | null,
  iconColor?: string | null
): React.ReactNode {
  const className = `h-5 w-5 ${iconColor || ''}`.trim();

  if (!iconName) {
    return createElement(LucideIcons.Globe, { className });
  }

  // Check react-icons map
  if (iconMap[iconName]) {
    return createElement(iconMap[iconName], { className });
  }

  // Check if it's a Lucide icon
  const lucideIcon = (LucideIcons as any)[iconName] || (LucideIcons as any)[iconName + 'Icon'];
  if (lucideIcon) {
    return createElement(lucideIcon, { className });
  }

  // Fallback to Globe icon
  console.warn(`Icon "${iconName}" not found, using default`);
  return createElement(LucideIcons.Globe, { className });
}

// Export specific lucide icons that might be needed elsewhere
export const {
  Calculator,
  Folder,
  Terminal,
  Code,
  Book,
  Globe,
  Search,
  Newspaper,
  TrendingUp,
  FileText,
  Database,
  Mail,
  Film,
  VolumeX,
  Volume2,
} = LucideIcons;
