import { SidebarNavItem } from "@app/components/SidebarNav"; import { Env } from "@app/lib/types/env"; import { build } from "@server/build"; import { Building2, ChartLine, Combine, CreditCard, Fingerprint, Globe, GlobeLock, KeyRound, Laptop, Link as LinkIcon, Logs, MonitorUp, Plug, ReceiptText, ScanEye, Server, Settings, SquareMousePointer, TicketCheck, User, UserCog, Users, Waypoints } from "lucide-react"; export type SidebarNavSection = { // Added from 'dev' branch heading: string; items: SidebarNavItem[]; }; export type OrgNavSectionsOptions = { isPrimaryOrg?: boolean; }; // Merged from 'user-management-and-resources' branch export const orgLangingNavItems: SidebarNavItem[] = [ { title: "sidebarAccount", href: "/{orgId}", icon: } ]; export const orgNavSections = ( env?: Env, options?: OrgNavSectionsOptions ): SidebarNavSection[] => [ { heading: "network", items: [ { title: "sidebarSites", href: "/{orgId}/settings/sites", icon: }, { title: "sidebarResources", icon: , items: [ { title: "sidebarProxyResources", href: "/{orgId}/settings/resources/proxy", icon: }, { title: "sidebarClientResources", href: "/{orgId}/settings/resources/client", icon: } ] }, { title: "sidebarClients", icon: , items: [ { href: "/{orgId}/settings/clients/user", title: "sidebarUserDevices", icon: }, { href: "/{orgId}/settings/clients/machine", title: "sidebarMachineClients", icon: } ] }, { title: "sidebarDomains", href: "/{orgId}/settings/domains", icon: }, ...(build == "saas" ? [ { title: "sidebarRemoteExitNodes", href: "/{orgId}/settings/remote-exit-nodes", icon: } ] : []) ] }, { heading: "access", items: [ { title: "sidebarTeam", icon: , items: [ { title: "sidebarUsers", href: "/{orgId}/settings/access/users", icon: }, { title: "sidebarRoles", href: "/{orgId}/settings/access/roles", icon: }, { title: "sidebarInvitations", href: "/{orgId}/settings/access/invitations", icon: } ] }, // PaidFeaturesAlert ...((build === "oss" && !env?.flags.disableEnterpriseFeatures) || build === "saas" || env?.app.identityProviderMode === "org" || (env?.app.identityProviderMode === undefined && build !== "oss") ? [ { title: "sidebarIdentityProviders", href: "/{orgId}/settings/idp", icon: } ] : []), ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "sidebarApprovals", href: "/{orgId}/settings/access/approvals", icon: } ] : []), { title: "sidebarShareableLinks", href: "/{orgId}/settings/share-links", icon: } ] }, { heading: "sidebarOrganization", items: [ { title: "sidebarLogsAndAnalytics", icon: , items: [ { title: "sidebarLogsAnalytics", href: "/{orgId}/settings/logs/analytics", icon: }, { title: "sidebarLogsRequest", href: "/{orgId}/settings/logs/request", icon: ( ) }, ...(!env?.flags.disableEnterpriseFeatures ? [ { title: "sidebarLogsAccess", href: "/{orgId}/settings/logs/access", icon: }, { title: "sidebarLogsAction", href: "/{orgId}/settings/logs/action", icon: } ] : []) ] }, { title: "sidebarManagement", icon: , items: [ { title: "sidebarApiKeys", href: "/{orgId}/settings/api-keys", icon: }, { title: "sidebarBluePrints", href: "/{orgId}/settings/blueprints", icon: } ] }, ...(build == "saas" && options?.isPrimaryOrg ? [ { title: "sidebarBillingAndLicenses", icon: , items: [ { title: "sidebarBilling", href: "/{orgId}/settings/billing", icon: ( ) }, { title: "sidebarEnterpriseLicenses", href: "/{orgId}/settings/license", icon: ( ) } ] } ] : []), { title: "sidebarSettings", href: "/{orgId}/settings/general", icon: } ] } ]; export const adminNavSections = (env?: Env): SidebarNavSection[] => [ { heading: "sidebarAdmin", items: [ { title: "sidebarAllUsers", href: "/admin/users", icon: }, { title: "sidebarApiKeys", href: "/admin/api-keys", icon: }, ...(build === "oss" || env?.app.identityProviderMode === "global" || env?.app.identityProviderMode === undefined ? [ { title: "sidebarIdentityProviders", href: "/admin/idp", icon: } ] : []), ...(build == "enterprise" ? [ { title: "sidebarLicense", href: "/admin/license", icon: } ] : []) ] } ];