import type { LucideIcon } from "lucide-react"
import {
  LayoutDashboard,
  Users,
  UserCircle2,
  ShieldCheck,
  AlertTriangle,
  Wallet,
  Coins,
  ArrowLeftRight,
  Send,
  PackageCheck,
  Warehouse,
  ArrowRightLeft,
  FileKey,
  PackageSearch,
  ClipboardList,
  AlertOctagon,
  LineChart,
  Percent,
  BookOpenText,
  SlidersHorizontal,
  GitCompareArrows,
  ScrollText,
  Bell,
  LifeBuoy,
  BarChart3,
  KeyRound,
  Settings,
  Building2,
  Archive,
  Truck,
  ClipboardCheck,
  Key,
  Box,
  Receipt,
  Landmark,
  Handshake,
  Scale,
  CircleDollarSign,
  ArrowDownToLine,
  Boxes,
  FileCheck2,
  FileWarning,
  RotateCcw,
} from "lucide-react"
import i18n from "@/lib/i18n";

export type NavItem = {
  title: string
  href: string
  icon: LucideIcon
  badge?: string
}

export type NavGroup = {
  title: string
  items: NavItem[]
}

export const getNavigation = (): NavGroup[] => [
  {
    title: i18n.t('lib.navigation.text_1'),
    items: [
      { title: i18n.t('lib.navigation.text_2'), href: "/", icon: LayoutDashboard },
    ],
  },
  {
    title: i18n.t('lib.navigation.text_3'),
    items: [
      { title: i18n.t('lib.navigation.text_4'), href: "/customers", icon: Users },
      { title: i18n.t('lib.navigation.text_5'), href: "/kyc", icon: ShieldCheck },
      { title: i18n.t('lib.navigation.text_6'), href: "/risk-aml", icon: AlertTriangle, badge: "3" },
    ],
  },
  {
    title: i18n.t('lib.navigation.text_7'),
    items: [
      { title: i18n.t('lib.navigation.text_8'), href: "/cash-wallet", icon: Wallet },
      { title: i18n.t('lib.navigation.text_9'), href: "/gold-wallet", icon: Coins },
      { title: i18n.t('components.finance.payment_operations.nav.receipt_vouchers'), href: "/finance/receipt-vouchers", icon: Receipt },
      { title: i18n.t('components.finance.payment_operations.nav.payment_vouchers'), href: "/finance/payment-vouchers", icon: Landmark },
      { title: i18n.t('components.finance.payment_operations.nav.settlements'), href: "/finance/settlements", icon: Handshake },
      { title: i18n.t('components.finance.payment_operations.nav.reconciliation'), href: "/finance/reconciliation", icon: Scale },
      { title: i18n.t('lib.navigation.text_10'), href: "/orders", icon: ArrowLeftRight },
      { title: i18n.t('lib.navigation.buy_orders', { defaultValue: 'Buy orders' }), href: "/buy-orders", icon: ArrowDownToLine },
      { title: i18n.t('lib.navigation.sell_orders', { defaultValue: 'Sell orders' }), href: "/sell-orders", icon: CircleDollarSign },
      { title: i18n.t('lib.navigation.text_11'), href: "/transfers", icon: Send },
      { title: i18n.t('lib.navigation.text_12'), href: "/redemptions", icon: PackageCheck },
    ],
  },
  {
    title: i18n.t('lib.navigation.text_13'),
    items: [
      { title: i18n.t('lib.navigation.inventory_logistics', { defaultValue: 'Inventory & Logistics' }), href: "/inventory-logistics", icon: Warehouse },
      { title: i18n.t('lib.navigation.suppliers', { defaultValue: 'Suppliers' }), href: "/suppliers", icon: Truck },
      { title: i18n.t('lib.navigation.purchase_requests', { defaultValue: 'Purchase requests' }), href: "/warehouse/purchase-requests", icon: ClipboardList },
      { title: i18n.t('lib.navigation.purchase_orders', { defaultValue: 'Purchase orders' }), href: "/purchase-orders", icon: ArrowDownToLine },
      { title: i18n.t('lib.navigation.supplier_shipments', { defaultValue: 'Supplier shipments' }), href: "/supplier-shipments", icon: Truck },
      { title: i18n.t('lib.navigation.text_14'), href: "/warehouse/receiving", icon: Truck },
      { title: i18n.t('lib.navigation.text_15'), href: "/warehouse/inspections", icon: ClipboardCheck },
      { title: i18n.t('lib.navigation.inbound_postings', { defaultValue: 'Stock Supply Order' }), href: "/inbound-postings", icon: FileCheck2 },
      { title: i18n.t('lib.navigation.purchase_returns', { defaultValue: 'Purchase returns' }), href: "/warehouse/purchase-returns", icon: RotateCcw },
      { title: i18n.t('lib.navigation.platform_allocation', { defaultValue: 'Platform allocation' }), href: "/warehouse/platform-allocation", icon: Boxes },
      { title: i18n.t('lib.navigation.branch_allocation', { defaultValue: 'Branch allocation' }), href: "/warehouse/branch-allocation", icon: Warehouse },
      { title: i18n.t('lib.navigation.text_16'), href: "/warehouse/transfers", icon: ArrowRightLeft },
      { title: i18n.t('lib.navigation.outbound_orders', { defaultValue: 'Stock Issue Orders' }), href: "/outbound-orders", icon: FileWarning },
      { title: i18n.t('lib.navigation.text_17'), href: "/warehouse/deliveries", icon: PackageSearch },
      { title: i18n.t('lib.navigation.text_18'), href: "/warehouse/custody", icon: FileKey },
      { title: i18n.t('lib.navigation.text_19'), href: "/warehouse/branches", icon: Building2 },
      { title: i18n.t('lib.navigation.text_20'), href: "/warehouse/vaults", icon: Archive },
      { title: i18n.t('lib.navigation.text_21'), href: "/bullion-bars", icon: Key },
      { title: i18n.t('lib.navigation.text_22'), href: "/inventory", icon: Box },
      { title: i18n.t('lib.navigation.text_23'), href: "/warehouse/stock-counts", icon: ClipboardList },
      { title: i18n.t('lib.navigation.text_24'), href: "/warehouse/incidents", icon: AlertOctagon },
      { title: i18n.t('lib.navigation.text_25'), href: "/pricing", icon: LineChart },
      { title: i18n.t('lib.navigation.text_26'), href: "/fees", icon: Percent },
    ],
  },
  {
    title: i18n.t('lib.navigation.text_27'),
    items: [
      { title: i18n.t('lib.navigation.text_28'), href: "/ledger/payments", icon: Receipt },
      { title: i18n.t('lib.navigation.accounting_settings', { defaultValue: 'Accounting settings' }), href: "/accounting-settings", icon: SlidersHorizontal },
      { title: i18n.t('lib.navigation.text_29'), href: "/ledger", icon: BookOpenText },
      { title: i18n.t('lib.navigation.text_30'), href: "/reconciliation", icon: GitCompareArrows },
      { title: i18n.t('lib.navigation.text_31'), href: "/audit-logs", icon: ScrollText },
    ],
  },
  {
    title: i18n.t('lib.navigation.text_35'),
    items: [
      { title: i18n.t('lib.navigation.text_35'), href: "/reports", icon: BarChart3 },
    ],
  },
  {
    title: i18n.t('lib.navigation.text_32'),
    items: [
      { title: i18n.t('lib.navigation.text_33'), href: "/notifications", icon: Bell },
      { title: i18n.t('lib.navigation.text_34'), href: "/support", icon: LifeBuoy },
    ],
  },
  {
    title: i18n.t('lib.navigation.text_36'),
    items: [
      { title: i18n.t('lib.navigation.text_37'), href: "/users", icon: UserCircle2 },
      { title: i18n.t('lib.navigation.text_38'), href: "/roles", icon: KeyRound },
      { title: i18n.t('lib.navigation.text_39'), href: "/settings", icon: Settings },
    ],
  },
]

export const navigation: NavGroup[] = getNavigation()
