import Link from 'next/link'; import { Sidebar, SidebarSection, SidebarItem, SidebarHeader, Row, SidebarProps, ThemeButton, } from '@umami/react-zen'; import { Globe, LayoutDashboard, Link as LinkIcon, Logo, Pixel, Settings, PanelLeft, } from '@/components/icons'; import { useMessages, useNavigation, useGlobalState } from '@/components/hooks'; import { TeamsButton } from '@/components/input/TeamsButton'; import { PanelButton } from '@/components/input/PanelButton'; import { ProfileButton } from '@/components/input/ProfileButton'; import { LanguageButton } from '@/components/input/LanguageButton'; export function SideNav(props: SidebarProps) { const { formatMessage, labels } = useMessages(); const { pathname, renderUrl, websiteId } = useNavigation(); const [isCollapsed, setIsCollapsed] = useGlobalState('sidenav-collapsed'); const hasNav = !!(websiteId || pathname.startsWith('/admin') || pathname.includes('/settings')); const links = [ { id: 'boards', label: formatMessage(labels.boards), path: '/boards', icon: , }, { id: 'websites', label: formatMessage(labels.websites), path: '/websites', icon: , }, { id: 'links', label: formatMessage(labels.links), path: '/links', icon: , }, { id: 'pixels', label: formatMessage(labels.pixels), path: '/pixels', icon: , }, ]; const bottomLinks = [ { id: 'settings', label: formatMessage(labels.settings), path: renderUrl('/settings'), icon: , }, ]; return ( setIsCollapsed(false)}> : } style={{ maxHeight: 40 }} > {!isCollapsed && !hasNav && } {links.map(({ id, path, label, icon }) => { return ( ); })} {bottomLinks.map(({ id, path, label, icon }) => { return ( ); })} {!isCollapsed && !hasNav && ( )} ); }