import type { ReactNode } from 'react';
import {
  AlertTriangle,
  BarChart3,
  Bell,
  BookOpen,
  Briefcase,
  ClipboardCheck,
  Clock,
  FileText,
  Globe,
  HandMetal,
  Heart,
  Home,
  Layers,
  LayoutGrid,
  MessageSquare,
  Shield,
  Timer,
  Wallet,
} from 'lucide-react';

const SIDEBAR_ICON_SIZE = 20;

const sidebarIcons: Record<string, ReactNode> = {
  home: <Home size={SIDEBAR_ICON_SIZE} />,
  frame: <LayoutGrid size={SIDEBAR_ICON_SIZE} />,
  book: <BookOpen size={SIDEBAR_ICON_SIZE} />,
  timer: <Timer size={SIDEBAR_ICON_SIZE} />,
  shield: <Shield size={SIDEBAR_ICON_SIZE} />,
  heart: <Heart size={SIDEBAR_ICON_SIZE} />,
  layers: <Layers size={SIDEBAR_ICON_SIZE} />,
  hand: <HandMetal size={SIDEBAR_ICON_SIZE} />,
  clock: <Clock size={SIDEBAR_ICON_SIZE} />,
  message: <MessageSquare size={SIDEBAR_ICON_SIZE} />,
  bell: <Bell size={SIDEBAR_ICON_SIZE} />,
  alert: <AlertTriangle size={SIDEBAR_ICON_SIZE} />,
  chart: <BarChart3 size={SIDEBAR_ICON_SIZE} />,
  file: <FileText size={SIDEBAR_ICON_SIZE} />,
  globe: <Globe size={SIDEBAR_ICON_SIZE} />,
  briefcase: <Briefcase size={SIDEBAR_ICON_SIZE} />,
  wallet: <Wallet size={SIDEBAR_ICON_SIZE} />,
  clipboard: <ClipboardCheck size={SIDEBAR_ICON_SIZE} />,
};

export function getSidebarIcon(icon: string): ReactNode {
  return sidebarIcons[icon] ?? <LayoutGrid size={SIDEBAR_ICON_SIZE} />;
}
