import {
Button,
type ButtonProps,
Column,
Focusable,
Icon,
Row,
Text,
ThemeButton,
Tooltip,
TooltipTrigger,
} from '@umami/react-zen';
import Link from 'next/link';
import type { Key } from 'react';
import { WebsiteNav } from '@/app/(main)/websites/[websiteId]/WebsiteNav';
import { IconLabel } from '@/components/common/IconLabel';
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 { Logo } from '@/components/svg';
export function SideNav(props: any) {
const { t, labels } = useMessages();
const { pathname, renderUrl, websiteId, router } = useNavigation();
const [isCollapsed, setIsCollapsed] = useGlobalState('sidenav-collapsed', false);
const hasNav = !!(websiteId || pathname.startsWith('/admin') || pathname.includes('/settings'));
const links = [
{
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: ,
},
];
const handleSelect = (id: Key) => {
router.push(id === 'user' ? '/websites' : `/teams/${id}/websites`);
};
return (
{!isCollapsed && (
}>
umami
)}
{websiteId ? (
) : (
{links.map(({ id, path, label, icon }) => {
const isSelected = pathname.startsWith(renderUrl(path, false));
return (
{label}
);
})}
)}
);
}
const PanelButton = (props: ButtonProps) => {
const [isCollapsed, setIsCollapsed] = useGlobalState('sidenav-collapsed', false);
return (
);
};