"use client"; import { observer } from "mobx-react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Image, BrainCog, Cog, Lock, Mail } from "lucide-react"; // plane internal packages import { WorkspaceIcon } from "@plane/propel/icons"; import { Tooltip } from "@plane/propel/tooltip"; import { cn } from "@plane/utils"; // hooks import { useTheme } from "@/hooks/store"; const INSTANCE_ADMIN_LINKS = [ { Icon: Cog, name: "General", description: "Identify your instances and get key details.", href: `/general/`, }, { Icon: WorkspaceIcon, name: "Workspaces", description: "Manage all workspaces on this instance.", href: `/workspace/`, }, { Icon: Mail, name: "Email", description: "Configure your SMTP controls.", href: `/email/`, }, { Icon: Lock, name: "Authentication", description: "Configure authentication modes.", href: `/authentication/`, }, { Icon: BrainCog, name: "Artificial intelligence", description: "Configure your OpenAI creds.", href: `/ai/`, }, { Icon: Image, name: "Images in Plane", description: "Allow third-party image libraries.", href: `/image/`, }, ]; export const AdminSidebarMenu = observer(() => { // store hooks const { isSidebarCollapsed, toggleSidebar } = useTheme(); // router const pathName = usePathname(); const handleItemClick = () => { if (window.innerWidth < 768) { toggleSidebar(!isSidebarCollapsed); } }; return (
{INSTANCE_ADMIN_LINKS.map((item, index) => { const isActive = item.href === pathName || pathName.includes(item.href); return (
{} {!isSidebarCollapsed && (
{item.name}
{item.description}
)}
); })}
); });