import type { LucideIcon } from 'lucide-react';
import {
  Activity,
  Brain,
  BookOpen,
  Cable,
  Clock,
  Cloud,
  Cpu,
  FileText,
  Folder,
  FolderOpen,
  Globe,
  Heart,
  Radio,
  Image as ImageIcon,
  KeyRound,
  Layers,
  Layers2,
  MessageSquare,
  Mic,
  ScrollText,
  Moon,
  Package,
  Palette,
  Plug,
  Search,
  Share2,
  Shield,
  SlidersHorizontal,
  Target,
  Timer,
  Users,
  Wrench,
} from 'lucide-react';

import type { Tab } from '@/i18n/messages';

const TAB_ICONS: Record<Tab, LucideIcon> = {
  chat: MessageSquare,
  sessions: FolderOpen,
  cron: Clock,
  skills: Layers,
  channels: Plug,
  agents: Users,
  logs: FileText,
  settingsOverview: Activity,
  settingsCredentials: KeyRound,
  settingsAgentDefaults: SlidersHorizontal,
  settingsAppearance: Palette,
  settingsSystem: Shield,
  settingsAppManagement: Package,
  settingsAgentChat: Cpu,
  settingsAgentWorkspace: Folder,
  settingsAgentBrowser: Globe,
  settingsAgentGeneration: SlidersHorizontal,
  settingsAgentRuntime: Timer,
  settingsAgentContext: Layers2,
  settingsAgentMemory: Brain,
  settingsAgentTools: Wrench,
  settingsAgentSkills: BookOpen,
  settingsAgentMcp: Cable,
  settingsAgentSystemPrompt: ScrollText,
  settingsAgents: Users,
  settingsProviders: Cloud,
  settingsModels: Cpu,
  settingsImageModels: ImageIcon,
  settingsChannels: Plug,
  settingsVoice: Mic,
  settingsGateway: Globe,
  settingsHeartbeat: Heart,
  settingsTunnel: Radio,
  settingsSearch: Search,
  settingsShares: Share2,
  settingsDreams: Moon,
  settingsCron: Clock,
  settingsGoals: Target,
};

export function TabIcon({ tab, className }: { tab: Tab; className?: string }) {
  const Icon = TAB_ICONS[tab];
  return <Icon className={className} strokeWidth={1.75} aria-hidden />;
}
