import React, { useState } from 'react'; import { HashRouter as Router, Routes, Route, Link, useLocation } from 'react-router-dom'; import { Bot, Phone, Book, User, LayoutDashboard, Mic2, Video, GitBranch, Zap, PanelLeftClose, PanelLeftOpen, History as HistoryIcon } from 'lucide-react'; import { AssistantsPage } from './pages/Assistants'; import { KnowledgeBasePage } from './pages/KnowledgeBase'; import { HistoryPage } from './pages/History'; import { ProfilePage } from './pages/Profile'; import { DashboardPage } from './pages/Dashboard'; import { VoiceLibraryPage } from './pages/VoiceLibrary'; import { WorkflowsPage } from './pages/Workflows'; import { WorkflowEditorPage } from './pages/WorkflowEditor'; import { AutoTestPage } from './pages/AutoTest'; const SidebarItem: React.FC<{ to: string; icon: React.ReactNode; label: string; active: boolean; isCollapsed: boolean }> = ({ to, icon, label, active, isCollapsed }) => (
{icon}
{!isCollapsed && {label}} ); const AppLayout: React.FC<{ children: React.ReactNode }> = ({ children }) => { const location = useLocation(); const [isCollapsed, setIsCollapsed] = useState(false); const navItems = [ { path: '/', label: '首页', icon: }, { path: '/assistants', label: '小助手', icon: }, { path: '/voices', label: '声音库', icon: }, { path: '/history', label: '历史记录', icon: }, { path: '/knowledge', label: '知识库', icon: }, { path: '/workflows', label: '工作流', icon: }, { path: '/auto-test', label: '测试助手', icon: }, { path: '/profile', label: '个人中心', icon: }, ]; return (
{/* Sidebar with Glass effect and collapse logic */} {/* Main Content */}
AI视频助手
{children}
); }; const App: React.FC = () => { return ( } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> ); }; export default App;