import Link from 'next/link';
import {
Sidebar,
SidebarSection,
SidebarItem,
SidebarHeader,
Row,
SidebarProps,
} from '@umami/react-zen';
import {
Globe,
LayoutDashboard,
Link as LinkIcon,
Logo,
Grid2X2,
Settings,
LockKeyhole,
} from '@/components/icons';
import { useMessages, useNavigation, useGlobalState } from '@/components/hooks';
import { WebsiteNav } from '@/app/(main)/websites/[websiteId]/WebsiteNav';
export function SideNav(props: SidebarProps) {
const { formatMessage, labels } = useMessages();
const { pathname, renderUrl, websiteId, teamId } = useNavigation();
const [isCollapsed] = useGlobalState('sidenav-collapsed');
const isWebsite = websiteId && !pathname.includes('/settings');
const links = [
{
id: 'websites',
label: formatMessage(labels.websites),
path: '/websites',
icon: ,
},
{
id: 'boards',
label: formatMessage(labels.boards),
path: '/boards',
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: '/settings',
icon: ,
},
{
id: 'admin',
label: formatMessage(labels.admin),
path: '/admin',
icon: ,
},
];
return (
} />
{links.map(({ id, path, label, icon }) => {
return (
);
})}
{!teamId &&
bottomLinks.map(({ id, path, label, icon }) => {
return (
);
})}
{isWebsite && }
);
}