Download apps/web/src/components/Layout.tsx from qf46578/omnics: direct link, hf CLI and curl.
- Browser
- Download file 3.21 kB
-
https://huggingface.co/spaces/qf46578/omnics/resolve/main/apps/web/src/components/Layout.tsx
- Command line
-
hf download hf://spaces/qf46578/omnics/apps/web/src/components/Layout.tsx
-
curl -L -o Layout.tsx https://huggingface.co/spaces/qf46578/omnics/resolve/main/apps/web/src/components/Layout.tsx
3.21 kB
| import { Outlet, Link, useLocation } from 'react-router-dom'; | |
| import { LayoutDashboard, MessageSquare, BookOpen, Settings, Bot, Users } from 'lucide-react'; | |
| const navigation = [ | |
| { name: '工作台', href: '/workbench', icon: MessageSquare }, | |
| { name: '数据看板', href: '/', icon: LayoutDashboard }, | |
| { name: '知识库', href: '/knowledge', icon: BookOpen }, | |
| { name: '自动化', href: '/automation', icon: Bot }, | |
| { name: '系统设置', href: '/settings', icon: Settings }, | |
| ]; | |
| export default function Layout() { | |
| const location = useLocation(); | |
| return ( | |
| <div className="flex h-screen bg-gray-50 dark:bg-gray-900"> | |
| {/* 侧边栏 */} | |
| <aside className="w-64 bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700"> | |
| <div className="flex items-center h-16 px-6 border-b border-gray-200 dark:border-gray-700"> | |
| <span className="text-xl font-bold bg-gradient-to-r from-blue-600 to-indigo-600 bg-clip-text text-transparent"> | |
| 🦞 OmniCS | |
| </span> | |
| </div> | |
| <nav className="p-4 space-y-1"> | |
| {navigation.map((item) => { | |
| const isActive = location.pathname === item.href; | |
| const Icon = item.icon; | |
| return ( | |
| <Link | |
| key={item.name} | |
| to={item.href} | |
| className={`flex items-center px-4 py-3 text-sm font-medium rounded-lg transition-all duration-200 ${ | |
| isActive | |
| ? 'bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400' | |
| : 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700' | |
| }`} | |
| > | |
| <Icon className="w-5 h-5 mr-3" /> | |
| {item.name} | |
| </Link> | |
| ); | |
| })} | |
| </nav> | |
| {/* 用户信息 */} | |
| <div className="absolute bottom-0 w-64 p-4 border-t border-gray-200 dark:border-gray-700"> | |
| <div className="flex items-center"> | |
| <div className="w-10 h-10 rounded-full bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center text-white font-bold"> | |
| 主 | |
| </div> | |
| <div className="ml-3"> | |
| <p className="text-sm font-medium text-gray-900 dark:text-white">主人</p> | |
| <p className="text-xs text-gray-500 dark:text-gray-400">在线</p> | |
| </div> | |
| </div> | |
| </div> | |
| </aside> | |
| {/* 主内容区 */} | |
| <main className="flex-1 overflow-auto"> | |
| <header className="h-16 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between px-6"> | |
| <h1 className="text-lg font-semibold text-gray-900 dark:text-white"> | |
| {navigation.find(n => n.href === location.pathname)?.name || '工作台'} | |
| </h1> | |
| <div className="flex items-center space-x-4"> | |
| <span className="text-sm text-gray-500 dark:text-gray-400"> | |
| 多平台智能客服系统 | |
| </span> | |
| </div> | |
| </header> | |
| <div className="p-6"> | |
| <Outlet /> | |
| </div> | |
| </main> | |
| </div> | |
| ); | |
| } | |