import { Fragment, useState } from "react"; import { t as i18nT } from "i18next"; import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger } from "../sheet"; import { Button } from "../button"; import Logo from "~/components/brand/Logo"; import { ScrollArea } from "../scroll-area"; import { Link } from "react-router"; import clsx from "clsx"; import { SideBarItem } from "~/application/sidebar/SidebarItem"; import { getUiIdAttributes, UI_ACTION_IDS } from "~/application/ui/uiRegistry"; import { MenuIcon } from "~/components/ui/icons/vendor"; export function MobileNav({ items }: { items: SideBarItem[] }) { const [open, setOpen] = useState(false); return ( {i18nT("docs.mobileNav.title")} {i18nT("docs.mobileNav.description")}
{items.map((item, index) => (
{item.items && item.items.length > 0 ? ( ) : item.path ? (

{item.title}

) : (

{item.title}

)} {item.items?.map((item) => ( {!item.disabled && (item.path ? ( {item.title} {item.side && ( {item.side} )} ) : ( item.title ))} ))}
))}
); } function MobileLink({ href, onOpenChange, className, children, uiItem, ...props }: { href: string; onOpenChange: (open: boolean) => void; className: string; children: React.ReactNode; uiItem?: SideBarItem; }) { return ( { onOpenChange?.(false); }} className={clsx(className)} {...(uiItem ? getUiIdAttributes(uiItem) : {})} {...props} > {children} ); }