import { Row, Sidebar, SidebarHeader, SidebarItem, type SidebarProps, SidebarSection, ThemeButton, } from '@umami/react-zen'; import Link from 'next/link'; import type { Key } from 'react'; import { useGlobalState, useMessages, useNavigation } from '@/components/hooks'; import { Globe, Grid2x2, LayoutDashboard, LinkIcon, PanelLeft } from '@/components/icons'; import { LanguageButton } from '@/components/input/LanguageButton'; import { NavButton } from '@/components/input/NavButton'; import { PanelButton } from '@/components/input/PanelButton'; import { Logo } from '@/components/svg'; export function SideNav(props: SidebarProps) { const { formatMessage, labels } = useMessages(); const { pathname, renderUrl, websiteId, router } = 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 handleSelect = (id: Key) => { router.push(id === 'user' ? '/websites' : `/teams/${id}/websites`); }; return ( setIsCollapsed(false)}> : } style={{ maxHeight: 40 }} > {!isCollapsed && !hasNav && } {links.map(({ id, path, label, icon }) => { return ( ); })} ); }