diff --git a/App.tsx b/App.tsx index 0f55462..007e71d 100644 --- a/App.tsx +++ b/App.tsx @@ -1,7 +1,7 @@ -import React from 'react'; +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 } from 'lucide-react'; +import { Bot, Phone, Book, User, LayoutDashboard, Mic2, Video, GitBranch, Zap, PanelLeftClose, PanelLeftOpen } from 'lucide-react'; import { AssistantsPage } from './pages/Assistants'; import { KnowledgeBasePage } from './pages/KnowledgeBase'; @@ -11,19 +11,22 @@ 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 }> = ({ to, icon, label, active }) => ( +const SidebarItem: React.FC<{ to: string; icon: React.ReactNode; label: string; active: boolean; isCollapsed: boolean }> = ({ to, icon, label, active, isCollapsed }) => ( - {icon} - {label} +
{icon}
+ {!isCollapsed && {label}} ); const AppLayout: React.FC<{ children: React.ReactNode }> = ({ children }) => { const location = useLocation(); + const [isCollapsed, setIsCollapsed] = useState(false); const navItems = [ { path: '/', label: '首页', icon: }, @@ -32,46 +35,66 @@ const AppLayout: React.FC<{ children: React.ReactNode }> = ({ children }) => { { path: '/call-logs', label: '视频通话记录', icon: }, { path: '/knowledge', label: '知识库', icon: }, { path: '/workflows', label: '工作流', icon: }, + { path: '/auto-test', label: '自动测试', icon: }, { path: '/profile', label: '个人中心', icon: }, ]; return (
- {/* Sidebar with Glass effect */} -