import { Link, Outlet, useLocation, useNavigate } from '../shared/router.jsx' import { cn } from '../lib/utils' import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider, SidebarRail, SidebarTrigger, useSidebar, } from '../components/ui/sidebar' import { Separator } from '../components/ui/separator' const menu = [ { section: '运营', items: [ { to: '/accounts/import', icon: 'ri-upload-cloud-2-line', label: '账号导入' }, { to: '/accounts', icon: 'ri-account-circle-line', label: '我的账号' }, { to: '/accounts/monitoring', icon: 'ri-eye-line', label: '监控账号' }, { to: '/creator/competitors', icon: 'ri-line-chart-line', label: '竞品分析' }, { to: '/creator/workbench', icon: 'ri-chat-3-line', label: '运营工作台' }, { to: '/creator/settings', icon: 'ri-settings-3-line', label: '采集设置' }, { to: '/tasks', icon: 'ri-task-line', label: '任务中心' }, ], }, { section: '资源', items: [ { to: '/browsers', icon: 'ri-hard-drive-3-line', label: '运行环境' }, { to: '/network-exits', icon: 'ri-earth-line', label: '网络出口' }, { to: '/gateways', icon: 'ri-router-line', label: '网关管理' }, ], }, ] function isActivePath(pathname, to) { return pathname === to || pathname.startsWith(`${to}/`) } function MenuLink({ item, pathname }) { const { isMobile, setOpenMobile } = useSidebar() return ( { if (isMobile) setOpenMobile(false) }}>