import {
  Home,
  Zap,
  Key,
  Package,
  TrendingUp,
  Building2,
  List,
  AlertTriangle,
  ShieldCheck,
  type LucideIcon,
} from 'lucide-react';

export interface NavItem {
  id: string;
  label: string;
  icon: LucideIcon;
}

export interface NavSection {
  title: string;
  items: NavItem[];
}

export const DOC_SECTIONS: NavSection[] = [
  {
    title: 'Démarrage',
    items: [
      { id: 'home', label: "Vue d'ensemble", icon: Home },
      { id: 'quickstart', label: 'Guide de démarrage', icon: Zap },
    ],
  },
  {
    title: 'Authentification',
    items: [{ id: 'authentication', label: 'Clés API', icon: Key }],
  },
  {
    title: 'Ressources API',
    items: [
      { id: 'bookings', label: 'Bookings', icon: Package },
      { id: 'rates', label: 'Tarifs', icon: TrendingUp },
      { id: 'organizations', label: 'Organisations', icon: Building2 },
    ],
  },
  {
    title: 'Référence',
    items: [
      { id: 'endpoints', label: 'Tous les endpoints', icon: List },
      { id: 'errors', label: "Codes d'erreur", icon: AlertTriangle },
      { id: 'rate-limiting', label: 'Rate Limiting', icon: ShieldCheck },
    ],
  },
];

export const ALL_NAV_ITEMS: NavItem[] = DOC_SECTIONS.flatMap(s => s.items);

export function findNavItem(id: string): NavItem | undefined {
  return ALL_NAV_ITEMS.find(item => item.id === id);
}
