import {
  LayoutDashboard,
  Users,
  Euro,
  Calendar,
  User,
  Bell,
  Megaphone,
  BarChart3,
  BellRing,
  Scissors,
  Bot,
  HelpCircle,
  CreditCard,
  History,
  MessageCircle,
  Globe
} from "lucide-react"

export interface NavItem {
  href: string
  icon: any
  label: string
  active: boolean
}

export function getNavItems(pathname: string, t?: (key: string) => string): NavItem[] {
  const translate = t || ((key: string) => key)

  // Strip locale prefix from pathname (e.g., /fr/dashboard -> /dashboard)
  const pathWithoutLocale = pathname.replace(/^\/(en|fr)/, '') || '/'

  return [
    {
      href: "/dashboard",
      icon: LayoutDashboard,
      label: translate("sidebar.dashboard"),
      active: pathWithoutLocale === "/dashboard"
    },
    {
      href: "/dashboard/staff",
      icon: Users,
      label: translate("sidebar.staff"),
      active: pathWithoutLocale === "/dashboard/staff"
    },
    {
      href: "/dashboard/services",
      icon: Scissors,
      label: translate("sidebar.services"),
      active: pathWithoutLocale.startsWith("/dashboard/services")
    },
    {
      href: "/dashboard/calendar",
      icon: Calendar,
      label: translate("sidebar.calendar"),
      active: pathWithoutLocale === "/dashboard/calendar"
    },
    {
      href: "/dashboard/customers",
      icon: User,
      label: translate("sidebar.customers"),
      active: pathWithoutLocale === "/dashboard/customers"
    },
    {
      href: "/dashboard/ai-assistant",
      icon: Bot,
      label: translate("sidebar.aiAssistant"),
      active: pathWithoutLocale === "/dashboard/ai-assistant"
    },
    {
      href: "/dashboard/reminders",
      icon: Bell,
      label: translate("sidebar.reminders"),
      active: pathWithoutLocale === "/dashboard/reminders"
    },
    {
      href: "/dashboard/marketing",
      icon: Megaphone,
      label: translate("sidebar.marketing"),
      active: pathWithoutLocale === "/dashboard/marketing"
    },
    {
      href: "/dashboard/analytics",
      icon: BarChart3,
      label: translate("sidebar.analytics"),
      active: pathWithoutLocale === "/dashboard/analytics"
    },
    // {
    //   href: "/dashboard/notifications",
    //   icon: BellRing,
    //   label: "Notifications",
    //   active: pathWithoutLocale === "/dashboard/notifications"
    // },
    {
      href: "/dashboard/earnings",
      icon: Euro,
      label: translate("sidebar.earnings"),
      active: pathWithoutLocale === "/dashboard/earnings"
    },
    {
      href: "/dashboard/credits",
      icon: CreditCard,
      label: translate("sidebar.credits"),
      active: pathWithoutLocale === "/dashboard/credits"
    },
    {
      href: "/dashboard/credits-usage",
      icon: History,
      label: translate("sidebar.creditsUsage"),
      active: pathWithoutLocale === "/dashboard/credits-usage"
    },
    // {
    //   href: "/dashboard/whatsapp-template",
    //   icon: MessageCircle,
    //   label: translate("sidebar.whatsappTemplate"),
    //   active: pathWithoutLocale === "/dashboard/whatsapp-template"
    // },
    // {
    //   href: "/dashboard/my-website",
    //   icon: Globe,
    //   label: translate("sidebar.myWebsite"),
    //   active: pathWithoutLocale === "/dashboard/my-website"
    // },
    {
      href: "/dashboard/support",
      icon: HelpCircle,
      label: translate("sidebar.support"),
      active: pathWithoutLocale === "/dashboard/support"
    }
  ]
}