
import {
  LayoutDashboard, 
  Users, 
  UserPlus, 
  ShoppingCart, 
  FileText,
  CreditCard, 
  Settings, 
  PieChart, 
  Wallet,
  Briefcase, 
  FileBarChart, 
  CheckSquare, 
  Upload, 
  Package,
  Truck, 
  FolderOpen, 
  PenTool, 
  History,
  BarChart3, 
  Scale, 
  BookOpen, 
  ScrollText,
  Tags, 
  Building2,
  Calculator,
  ListTodo,
  ShieldCheck,
  PanelLeft,
  MessageSquare,
} from 'lucide-react';

export const MODULE_GESTION = 'gestion';
export const MODULE_COMPTABILITE = 'compta';

export const getMenuForModule = (currentModule) => {
  if (currentModule === MODULE_COMPTABILITE) {
    return [
      {
        title: "Pilotage",
        items: [
          { to: "/comptabilite/dashboard", icon: LayoutDashboard, label: "Tableau de bord" },
          { to: "/comptabilite/transactions", icon: Wallet, label: "Banque & Transactions" },
        ]
      },
      {
        title: "Saisie & Journaux",
        items: [
          { to: "/comptabilite/ecritures", icon: PenTool, label: "Saisie d'écritures" },
          { to: "/comptabilite/journaux", icon: BookOpen, label: "Journaux" },
          { to: "/comptabilite/rapprochement", icon: Scale, label: "Rapprochement" },
        ]
      },
      {
        title: "États & Déclarations",
        items: [
          { to: "/comptabilite/grand-livre", icon: ScrollText, label: "Grand Livre" },
          { to: "/comptabilite/balance-generale", icon: Scale, label: "Balance Générale" },
          { to: "/comptabilite/balance-clients", icon: Users, label: "Balance Clients" },
          { to: "/comptabilite/balance-fournisseurs", icon: Building2, label: "Balance Fournisseurs" },
          { to: "/comptabilite/tva", icon: FileText, label: "Déclaration TVA" },
        ]
      },
      {
        title: "Paramètres",
        items: [
          { to: "/comptabilite/plan-comptable", icon: Tags, label: "Plan Comptable" },
          { to: "/comptabilite/analytique", icon: PieChart, label: "Analytique" },
          { to: "/comptabilite/imports-exports", icon: Upload, label: "Imports / Exports" },
        ]
      }
    ];
  }

  // Default to MODULE_GESTION
  return [
    {
      title: "Pilotage",
      items: [
        { to: "/home/", icon: LayoutDashboard, label: "Tableau de bord", end: true },
      ]
    },
    {
      title: "Relations Tiers",
      items: [
        // { to: "/home/prospects", icon: UserPlus, label: "Prospects" },
        { to: "/home/clients", icon: Users, label: "Clients" },
        { to: "/home/fournisseurs", icon: Building2, label: "Fournisseurs" },
      ]
    },
    {
      title: "Ventes",
      items: [
        { to: "/home/devis", icon: FileText, label: "Devis" },
        { to: "/home/commandes", icon: ShoppingCart, label: "Commandes" },
        { to: "/home/bons-livraison", icon: Truck, label: "Bons de livraison" },
        { to: "/home/factures", icon: FileBarChart, label: "Factures" },
        { to: "/home/avoirs", icon: FileText, label: "Avoirs" },
        // { to: "/home/relances", icon: History, label: "Relances" },
        { to: "/home/reglements", icon: CreditCard, label: "Règlements" },
      ]
    },
    {
      title: "Catalogue",
      items: [
        { to: "/home/articles", icon: Package, label: "Articles" },
        { to: "/home/familles-articles", icon: Tags, label: "Familles" },
      ]
    },
    {
      title: "Vues personnalisées",
      items: [
        { to: "/home/sage-builder", icon: PanelLeft, label: "Tableau des ventes" },
      ]
    },
    {
      title: "Modules",
      items: [
        { to: "/home/ask-ia", icon: MessageSquare, label: "Sage Ask.AI" },
      ]
    },
    // {
    //   title: "Signature",
    //   items: [
    //     { to: "/home/signature/dashboard", icon: PenTool, label: "Tableau de bord" },
    //     { to: "/home/signature/tracking", icon: History, label: "Suivi" },
    //     { to: "/home/signature/purchase", icon: ShoppingCart, label: "Acheter des crédits" },
    //   ]
    // },
    // {
    //   title: "Administration",
    //   items: [
    //     { to: "/home/utilisateurs", icon: Users, label: "Utilisateurs" },
    //     { to: "/home/parametres", icon: Settings, label: "Paramètres" },
    //   ]
    // }
  ];
};
