/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import { observer } from "mobx-react"; import Link from "next/link"; import { usePathname } from "next/navigation"; // plane internal packages import { Tooltip } from "@plane/propel/tooltip"; import { cn } from "@plane/utils"; // hooks import { useTheme } from "@/hooks/store"; import { useSidebarMenu } from "@/hooks/use-sidebar-menu"; export const AdminSidebarMenu = observer(function AdminSidebarMenu() { // router const pathName = usePathname(); // store hooks const { isSidebarCollapsed, toggleSidebar } = useTheme(); // derived values const sidebarMenu = useSidebarMenu(); const handleItemClick = () => { if (window.innerWidth < 768) { toggleSidebar(!isSidebarCollapsed); } }; return (
{sidebarMenu.map((item, index) => { const isActive = item.href === pathName || pathName?.includes(item.href); return (
{} {!isSidebarCollapsed && (
{item.name}
{item.description}
)}
); })}
); });