'use client'
import { useConfig } from 'nextra-theme-docs'
import { usePathname } from 'next/navigation'
import Link from 'next/link'
import { useState, useEffect } from 'react'
import { createPortal } from 'react-dom'
import {
House,
RocketLaunch,
Lightning,
Cloud,
AppWindow,
BookOpen,
PencilSimple,
Brain,
Users,
Buildings,
GraduationCap,
ChalkboardTeacher,
Stack,
Path,
Cube,
UsersThree,
DownloadSimple,
Gear,
Wrench,
ListChecks,
Terminal,
TreeStructure,
GitBranch,
Plug,
Browser,
Database,
HardDrives,
Key,
Envelope,
Folder,
Lock,
ArrowsClockwise,
ClockCountdown,
ChartBar,
Lifebuoy,
ShieldCheck,
Code,
BookBookmark,
SlidersHorizontal,
ClipboardText,
Trophy,
CheckCircle,
GameController,
ChatCircle,
ChatDots,
ThumbsUp,
Kanban,
ChalkboardSimple,
Microphone,
MagnifyingGlass,
Certificate,
Briefcase,
CreditCard,
Storefront,
ShoppingCart,
Receipt,
IdentificationBadge,
Package,
Scroll,
} from '@phosphor-icons/react/dist/ssr'
const ICON_SIZE = 15
const iconMap = {
// Root level
'/': House,
'/getting-started': RocketLaunch,
'/platform': AppWindow,
'/enterprise': Briefcase,
'/self-hosting': Cloud,
'/developers': Code,
// Getting Started
'/getting-started/quickstart': Lightning,
'/getting-started/cloud-vs-self-hosting': Cloud,
'/getting-started/key-concepts': BookOpen,
// Platform
'/platform/courses': BookBookmark,
'/platform/editor': PencilSimple,
'/platform/ai': Brain,
'/platform/users': Users,
'/platform/organizations': Buildings,
// Platform > Courses
'/platform/courses/chapters-and-activities': Stack,
'/platform/courses/collections': Folder,
'/platform/courses/trails': Path,
// Platform > Editor
'/platform/editor/blocks': Cube,
// Platform > AI
'/platform/ai/for-students': GraduationCap,
'/platform/ai/for-teachers': ChalkboardTeacher,
// Platform > Users
'/platform/users/roles-and-permissions': ShieldCheck,
'/platform/users/authentication': Key,
// Platform > Assignments
'/platform/assignments': ClipboardText,
'/platform/assignments/grading': CheckCircle,
// Platform > Code Execution
'/platform/code-execution': Terminal,
// Platform > Playgrounds
'/platform/playgrounds': GameController,
// Platform > Discussions
'/platform/discussions': ChatCircle,
'/platform/discussions/comments': ChatDots,
// Platform > Boards
'/platform/boards': ChalkboardSimple,
// Platform > Podcasts
'/platform/podcasts': Microphone,
// Platform > Certifications
'/platform/certifications': Certificate,
// Platform > Analytics
'/platform/analytics': ChartBar,
// Platform > Search
'/platform/search': MagnifyingGlass,
// Platform > Payments
'/platform/payments': CreditCard,
'/platform/payments/offers': Storefront,
'/platform/payments/groups': ShoppingCart,
'/platform/payments/enrollments': Receipt,
// Platform > Organizations
'/platform/organizations/multi-tenancy': TreeStructure,
'/platform/organizations/settings': SlidersHorizontal,
// Enterprise
'/enterprise/sso': IdentificationBadge,
'/enterprise/audit-logs': Scroll,
'/enterprise/scorm': Package,
// Self Hosting
'/self-hosting/installation': DownloadSimple,
'/self-hosting/configuration': Gear,
'/self-hosting/maintenance': Wrench,
// Self Hosting > Installation
'/self-hosting/installation/requirements': ListChecks,
'/self-hosting/installation/quick-install': Lightning,
'/self-hosting/installation/cli-reference': Terminal,
// Self Hosting > Configuration
'/self-hosting/configuration/environment-variables': Code,
'/self-hosting/configuration/ai-setup': Brain,
'/self-hosting/configuration/email': Envelope,
'/self-hosting/configuration/storage': HardDrives,
'/self-hosting/configuration/ssl': Lock,
// Self Hosting > Maintenance
'/self-hosting/maintenance/updates': ArrowsClockwise,
'/self-hosting/maintenance/backups': ClockCountdown,
'/self-hosting/maintenance/monitoring': ChartBar,
'/self-hosting/maintenance/troubleshooting': Lifebuoy,
// CLI
'/cli': Terminal,
'/cli/commands': ListChecks,
'/cli/setup-wizard': Lightning,
'/cli/dev-mode': Code,
'/cli/environment-variables': Gear,
// Developers
'/developers/architecture': TreeStructure,
'/developers/contributing': GitBranch,
'/developers/api': Plug,
// Developers > Architecture
'/developers/architecture/frontend': Browser,
'/developers/architecture/backend': Database,
'/developers/architecture/services': HardDrives,
// Developers > Contributing
'/developers/contributing/dev-environment': Terminal,
'/developers/contributing/guidelines': BookOpen,
// Developers > API
'/developers/api/authentication': Key,
'/developers/api/endpoints': Plug,
}
function getIcon(route) {
const Icon = iconMap[route]
if (!Icon) return null
return