import { 
  Activity, 
  Truck, 
  HeartPulse, 
  Hospital, 
  PieChart, 
  Users, 
  Settings, 
  ShieldCheck, 
  LayoutDashboard,
  Monitor,
  Database,
  Zap,
  PhoneCall,
  Navigation,
  ShoppingCart,
  LayoutGrid
} from 'lucide-react';

export interface NavItem {
  id: string;
  label: string;
  icon: any;
  path: string;
  roles: string[];
  subItems?: NavItem[];
  portalContext?: string; // If set, this item and its sub-items belong to a specific portal
}

export const NAVIGATION_CONFIG: NavItem[] = [
  { 
    id: 'launcher', 
    label: 'Portal Hub', 
    icon: Monitor, 
    path: '/launcher', 
    roles: ['CURESELECT_ADMIN'] 
  },
  { 
    id: 'overview', 
    label: 'Admin Dashboard', 
    icon: LayoutDashboard, 
    path: '/', 
    roles: ['CURESELECT_ADMIN'] 
  },
  { 
    id: 'incidents', 
    label: 'Incident Command', 
    icon: Activity, 
    path: '/incidents', 
    roles: ['CURESELECT_ADMIN', 'PILOT', 'COORDINATOR'] 
  },
  { 
    id: 'caller', 
    label: 'Caller Portal', 
    icon: PhoneCall, 
    path: '/caller', 
    roles: ['CURESELECT_ADMIN', 'CALLER'] 
  },
  { id: 'fleet-overview',      label: 'Live Dashboard',     icon: LayoutGrid,    path: '/fleet-operator?tab=overview',      roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
  { id: 'fleet-organization',  label: 'Org & Stations',     icon: Hospital,      path: '/fleet-operator?tab=organization',   roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
  { id: 'fleet-assets',        label: 'Fleet Assets',       icon: Truck,         path: '/fleet-operator?tab=assets',         roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
  { id: 'fleet-personnel',     label: 'Staf Management',      icon: Users,         path: '/fleet-operator?tab=personnel',      roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
  { id: 'fleet-mission',       label: 'Crew Scheduling',    icon: Navigation,    path: '/fleet-operator?tab=scheduling',     roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
  { id: 'fleet-inventory',     label: 'Inventory Management',       icon: ShoppingCart,  path: '/fleet-operator?tab=inventory',      roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
  { id: 'fleet-trips',         label: 'Trip Management',    icon: Activity,      path: '/fleet-operator?tab=trips',          roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
  // { id: 'fleet-telematics',    label: 'GPS Telematics',     icon: Navigation,    path: '/fleet-operator?tab=telematics',     roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
  // { id: 'fleet-referrals',     label: 'Referral Network',   icon: HeartPulse,    path: '/fleet-operator?tab=referrals',      roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
  { id: 'fleet-intel',         label: 'Fleet Analytics',    icon: PieChart,      path: '/fleet-operator?tab=analytics',      roles: ['CURESELECT_ADMIN', 'FLEET_OPERATOR'] },
  { 
    id: 'clinical', 
    label: 'Clinical Intelligence', 
    icon: HeartPulse, 
    path: '/clinical', 
    roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'EMT'] 
  },
  { 
    id: 'hospitals', 
    label: 'Hospital Network', 
    icon: Hospital, 
    path: '/hospitals', 
    roles: ['CURESELECT_ADMIN'] 
  },
  { 
    id: 'hospital-console', 
    label: 'Hospital Ops', 
    icon: Monitor, 
    path: '/hospital-console', 
    roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'ED_DOCTOR', 'COORDINATOR', 'EMT'] 
  },
  { 
    id: 'master-data', 
    label: 'Platform Masters', 
    icon: Database, 
    path: '/master-data', 
    roles: ['CURESELECT_ADMIN'] 
  },
  { 
    id: 'analytics', 
    label: 'Business Intelligence', 
    icon: PieChart, 
    path: '/analytics', 
    roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN', 'STATION_INCHARGE'] 
  },
  { 
    id: 'users', 
    label: 'Identity & Access', 
    icon: Users, 
    path: '/users', 
    roles: ['CURESELECT_ADMIN'] 
  },
  { 
    id: 'config', 
    label: 'System Config', 
    icon: Settings, 
    path: '/config', 
    roles: ['CURESELECT_ADMIN'] 
  },
  { 
    id: 'compliance', 
    label: 'Audit & Compliance', 
    icon: ShieldCheck, 
    path: '/compliance', 
    roles: ['CURESELECT_ADMIN', 'HOSPITAL_ADMIN'] 
  },
  { 
    id: 'health', 
    label: 'Infrastructure Health', 
    icon: Zap, 
    path: '/health', 
    roles: ['CURESELECT_ADMIN'] 
  },
];
