import {
  Sparkles, Home, Hash, LayoutDashboard, FileText, Target,
  Users, Database, PenTool, Building2, Plug, Activity, Bot, ScrollText, Settings,
} from 'lucide-react';

export type NavItem = {
  label: string;
  href: string;
  icon: React.ComponentType<{ className?: string }>;
  badge?: 'New' | number;
  permission?: string;   // gate key; hidden if the user lacks it
  platformOnly?: boolean; // visible only to platform admins
};

// Mirrors the Databox reference sidebar structure. Admin items only render when
// authorized (see usePage().props.auth.can, populated by HandleInertiaRequests).
export const primaryNav: NavItem[] = [
  { label: 'AI Analyst', href: '/ai', icon: Sparkles, badge: 'New', permission: 'ai.use' },
  { label: 'Home', href: '/', icon: Home },
  { label: 'Metrics', href: '/metrics', icon: Hash },
  { label: 'Dashboards', href: '/dashboards', icon: LayoutDashboard, permission: 'dashboards.view' },
  { label: 'Reports', href: '/reports', icon: FileText },
  { label: 'Goals & OKRs', href: '/goals', icon: Target },
  { label: 'Spaces', href: '/spaces', icon: Users },
  { label: 'Data Manager', href: '/data-manager', icon: Database, permission: 'integrations.manage' },
];

export const adminNav: NavItem[] = [
  { label: 'Dashboard Studio', href: '/admin/studio', icon: PenTool, platformOnly: true },
  { label: 'Organizations', href: '/admin/organizations', icon: Building2, platformOnly: true },
  { label: 'Users & Roles', href: '/admin/users', icon: Users, platformOnly: true },
  { label: 'Integrations', href: '/admin/integrations', icon: Plug, platformOnly: true },
  { label: 'Sync Monitor', href: '/admin/sync-monitor', icon: Activity, platformOnly: true },
  { label: 'AI Configuration', href: '/admin/ai-config', icon: Bot, platformOnly: true },
  { label: 'Audit Logs', href: '/admin/audit', icon: ScrollText, platformOnly: true },
  { label: 'System Settings', href: '/admin/settings', icon: Settings, platformOnly: true },
];
