import React from 'react';
import { 
  AppstoreOutlined, SettingOutlined, UserOutlined, 
  TeamOutlined, SafetyCertificateOutlined, FileTextOutlined,
  HomeOutlined, BarChartOutlined, DatabaseOutlined, 
  SafetyOutlined, KeyOutlined, ToolOutlined,
  NotificationOutlined, MessageOutlined, MailOutlined,
  CloudOutlined, DownloadOutlined, UploadOutlined,
  LockOutlined, UnlockOutlined, EyeOutlined,
  EditOutlined, DeleteOutlined, PlusOutlined,
  AuditOutlined, BookOutlined, CalendarOutlined,
  DashboardOutlined, ExperimentOutlined, FireOutlined,
  GlobalOutlined, InsuranceOutlined, MedicineBoxOutlined,
  ProjectOutlined, ReadOutlined, RocketOutlined,
  SaveOutlined, ShopOutlined, ShoppingOutlined,
  TagOutlined, TrophyOutlined, VideoCameraOutlined
} from "@ant-design/icons";

export const ICON_MAP: Record<string, React.ReactNode> = {
  'appstore': <AppstoreOutlined />,
  'setting': <SettingOutlined />,
  'user': <UserOutlined />,
  'team': <TeamOutlined />,
  'safety': <SafetyCertificateOutlined />,
  'file': <FileTextOutlined />,
  'home': <HomeOutlined />,
  'chart': <BarChartOutlined />,
  'database': <DatabaseOutlined />,
  'key': <KeyOutlined />,
  'tool': <ToolOutlined />,
  'notification': <NotificationOutlined />,
  'message': <MessageOutlined />,
  'mail': <MailOutlined />,
  'cloud': <CloudOutlined />,
  'download': <DownloadOutlined />,
  'upload': <UploadOutlined />,
  'lock': <LockOutlined />,
  'unlock': <UnlockOutlined />,
  'eye': <EyeOutlined />,
  'edit': <EditOutlined />,
  'delete': <DeleteOutlined />,
  'plus': <PlusOutlined />,
  'audit': <AuditOutlined />,
  'book': <BookOutlined />,
  'calendar': <CalendarOutlined />,
  'dashboard': <DashboardOutlined />,
  'experiment': <ExperimentOutlined />,
  'fire': <FireOutlined />,
  'global': <GlobalOutlined />,
  'insurance': <InsuranceOutlined />,
  'medicine': <MedicineBoxOutlined />,
  'project': <ProjectOutlined />,
  'read': <ReadOutlined />,
  'rocket': <RocketOutlined />,
  'save': <SaveOutlined />,
  'shop': <ShopOutlined />,
  'shopping': <ShoppingOutlined />,
  'tag': <TagOutlined />,
  'trophy': <TrophyOutlined />,
  'video': <VideoCameraOutlined />,
};

export const ICON_LIST = Object.keys(ICON_MAP).map(key => ({
  name: key,
  icon: ICON_MAP[key]
}));

export const getIcon = (iconName?: string | null) => {
  if (!iconName) return null;
  return ICON_MAP[iconName] || <AppstoreOutlined />;
};
