import { BotMessageSquare, Calendars, Compass, KeyRound, Languages, LibraryBig, Settings, } from 'lucide-react'; import { useOnborda } from 'onborda'; import { useNavigate, useLocation } from 'react-router-dom'; import AgentScope from '@/assets/images/agentscope.svg?react'; import { CHAT_TOUR_NAME } from '@/components/tour/chatTourSteps'; import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, } from '@/components/ui/sidebar'; import i18n from '@/i18n'; import { useTranslation } from '@/i18n/useI18n'; export function AppSidebar() { const navigate = useNavigate(); const location = useLocation(); const { t } = useTranslation(); const { startOnborda } = useOnborda(); const handleStartTour = () => { if (!location.pathname.startsWith('/chat')) { // Page not mounted yet — leave a flag, navigate, and let the // ChatTourController auto-trigger after ChatPage mounts. sessionStorage.setItem('force_tour', '1'); navigate('/chat'); } else { startOnborda(CHAT_TOUR_NAME); } }; const handleToggleLanguage = () => { const next = i18n.language.startsWith('zh') ? 'en' : 'zh'; i18n.changeLanguage(next); }; return (
navigate('/chat')} className="px-2.5 md:px-2" > navigate('/schedule')} className="px-2" > navigate('/credential')} className="px-2" > navigate('/knowledge')} className="px-2" > navigate('/setup')} className="px-2" >
); }