import { Button, type ButtonProps, Column, Focusable, Icon, Row, Text, Tooltip, TooltipTrigger, } from '@umami/react-zen'; import { AdminNav } from '@/app/(main)/admin/AdminNav'; import { SettingsNav } from '@/app/(main)/settings/SettingsNav'; import { WebsiteNav } from '@/app/(main)/websites/[websiteId]/WebsiteNav'; import { IconLabel } from '@/components/common/IconLabel'; import Link from '@/components/common/Link'; import { useGlobalState, useMessages, useNavigation } from '@/components/hooks'; import { Globe, Grid2x2, LayoutDashboard, LinkIcon, PanelLeft, PanelsLeftBottom, } from '@/components/icons'; import { UserButton } from '@/components/input/UserButton'; import { Logo } from '@/components/svg'; export function SideNav(props: any) { const { t, labels } = useMessages(); const { pathname, renderUrl, websiteId, teamId } = useNavigation(); const [isCollapsed] = useGlobalState('sidenav-collapsed', false); const links = [ ...(!teamId ? [ { id: 'dashboard', label: t(labels.dashboard), path: '/dashboard', icon: , }, ] : []), { id: 'boards', label: t(labels.boards), path: '/boards', icon: , }, { id: 'websites', label: t(labels.websites), path: '/websites', icon: , }, { id: 'links', label: t(labels.links), path: '/links', icon: , }, { id: 'pixels', label: t(labels.pixels), path: '/pixels', icon: , }, ]; return ( {!isCollapsed && ( }> umami )} {websiteId ? ( ) : pathname.includes('/settings') ? ( ) : pathname.includes('/admin') ? ( ) : ( {links.map(({ id, path, label, icon }) => { const isSelected = pathname.startsWith(renderUrl(path, false)); const content = ( ); return ( {isCollapsed ? ( {content} {label} ) : ( content )} ); })} )} ); } const PanelButton = (props: ButtonProps) => { const [isCollapsed, setIsCollapsed] = useGlobalState('sidenav-collapsed', false); return ( ); };