"use client" import { BarsThree, QuestionMarkCircle, SidebarLeft, TimelineVertical, } from "@medusajs/icons" import React, { useMemo, useRef, useState } from "react" import { BookIcon, Button, getOsShortcut, Menu, useClickOutside, useSidebar, } from "../../.." import clsx from "clsx" import { HouseIcon } from "../../Icons/House" import { MainNavThemeMenu } from "./ThemeMenu" import { MenuItem } from "types" export const MainNavDesktopMenu = () => { const [isOpen, setIsOpen] = useState(false) const { setDesktopSidebarOpen, isSidebarShown, desktopSidebarOpen } = useSidebar() const ref = useRef(null) useClickOutside({ elmRef: ref, onClickOutside: () => setIsOpen(false), }) const items: MenuItem[] = useMemo(() => { const items: MenuItem[] = [ { type: "link", icon: , title: "Homepage", link: "https://medusajs.com", }, { type: "link", icon: , title: "Medusa v1", link: "https://docs.medusajs.com/v1", }, { type: "link", icon: , title: "Changelog", link: "https://medusajs.com/changelog", }, { type: "link", icon: , title: "Troubleshooting", link: "https://docs.medusajs.com/resources/troubleshooting", }, ] if (isSidebarShown) { items.push( { type: "divider", }, { type: "action", title: desktopSidebarOpen ? "Hide Sidebar" : "Show Sidebar", icon: , shortcut: `${getOsShortcut()}\\`, action: () => { setDesktopSidebarOpen((prev) => !prev) setIsOpen(false) }, } ) } items.push( { type: "divider", }, { type: "custom", content: , } ) return items }, [isSidebarShown, desktopSidebarOpen]) return (
) }