"use client"; import React from "react"; import { observer } from "mobx-react"; import Link from "next/link"; import { useParams, usePathname } from "next/navigation"; import { Crown } from "lucide-react"; // ui import { Tooltip } from "@plane/ui"; // components import { NotificationPopover } from "@/components/notifications"; // constants import { SIDEBAR_MENU_ITEMS } from "@/constants/dashboard"; import { SIDEBAR_CLICKED } from "@/constants/event-tracker"; import { EUserWorkspaceRoles } from "@/constants/workspace"; // helper import { cn } from "@/helpers/common.helper"; // hooks import { useAppTheme, useEventTracker, useUser } from "@/hooks/store"; import { usePlatformOS } from "@/hooks/use-platform-os"; export const WorkspaceSidebarMenu = observer(() => { // store hooks const { toggleSidebar, sidebarCollapsed } = useAppTheme(); const { captureEvent } = useEventTracker(); const { isMobile } = usePlatformOS(); const { membership: { currentWorkspaceRole }, } = useUser(); // router params const { workspaceSlug } = useParams(); // pathname const pathname = usePathname(); // computed const workspaceMemberInfo = currentWorkspaceRole || EUserWorkspaceRoles.GUEST; const handleLinkClick = (itemKey: string) => { if (window.innerWidth < 768) { toggleSidebar(); } captureEvent(SIDEBAR_CLICKED, { destination: itemKey, }); }; return (
{link.label}
} {!sidebarCollapsed && link.key === "active-cycles" && (