// 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 {
  FaCog,
  FaCode,
  FaAws,
  FaCalendarAlt,
  FaImage,
  FaTerminal,
  FaMicrophone,
  FaRobot,
  FaFolder,
  FaFileExport,
  FaVideo,
  FaBrain,
  FaChartBar,
  FaGlobe,
  FaConnectdevelop,
  FaFileCsv,
  FaChartArea,
  FaChartLine,
  FaSpider,
  FaPalette,
  FaChrome,
  FaSearch,
  FaGoogle,
  FaHackerNews,
  FaNewspaper,
  FaFileAlt,
} from 'react-icons/fa';
import {
  SiDiscord,
  SiSlack,
  SiTelegram,
  SiTwilio,
  SiWebex,
  SiWhatsapp,
  SiBitbucket,
  SiConfluence,
  SiDocker,
  SiElevenlabs,
  SiGooglegemini,
  SiGithub,
  SiGooglebigquery,
  SiGooglemaps,
  SiGooglesheets,
  SiJira,
  SiLinear,
  SiNeo4J,
  SiOpenai,
  SiPostgresql,
  SiPython,
  SiAmazonredshift,
  SiTrello,
  SiZendesk,
  SiGmail,
  SiSpotify,
  SiYoutube,
  SiShopify,
  SiClickup,
  SiGooglecalendar,
  SiNotion,
  SiTodoist,
  SiArxiv,
  SiBrave,
  SiDuckduckgo,
  SiPubmed,
  SiUnsplash,
  SiWikipedia,
  SiReddit,
  SiX,
  SiZoom,
} from 'react-icons/si';

// Map of all icons we use
const iconMap: Record<string, any> = {
  FaCog,
  FaCode,
  FaAws,
  FaCalendarAlt,
  FaImage,
  FaTerminal,
  FaMicrophone,
  FaRobot,
  FaFolder,
  FaFileExport,
  FaVideo,
  FaBrain,
  FaChartBar,
  FaGlobe,
  FaConnectdevelop,
  FaFileCsv,
  FaChartArea,
  FaChartLine,
  FaSpider,
  FaPalette,
  FaChrome,
  FaSearch,
  FaGoogle,
  FaHackerNews,
  FaNewspaper,
  FaFileAlt,
  SiDiscord,
  SiSlack,
  SiTelegram,
  SiTwilio,
  SiWebex,
  SiWhatsapp,
  SiBitbucket,
  SiConfluence,
  SiDocker,
  SiElevenlabs,
  SiGooglegemini,
  SiGithub,
  SiGooglebigquery,
  SiGooglemaps,
  SiGooglesheets,
  SiJira,
  SiLinear,
  SiNeo4J,
  SiOpenai,
  SiPostgresql,
  SiPython,
  SiAmazonredshift,
  SiTrello,
  SiZendesk,
  SiGmail,
  SiSpotify,
  SiYoutube,
  SiShopify,
  SiClickup,
  SiGooglecalendar,
  SiNotion,
  SiTodoist,
  SiArxiv,
  SiBrave,
  SiDuckduckgo,
  SiPubmed,
  SiUnsplash,
  SiWikipedia,
  SiReddit,
  SiX,
  SiZoom,
  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;
