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 } from 'lucide-react';
import { AssistantsPage } from './pages/Assistants';
import { KnowledgeBasePage } from './pages/KnowledgeBase';
import { CallLogsPage } from './pages/CallLogs';
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: '/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 and collapse logic */}
{/* Main Content */}
{children}
);
};
const App: React.FC = () => {
return (
} />
} />
} />
} />
} />
} />
} />
} />
} />
} />
);
};
export default App;