import React, { useContext } from 'react'; import { BrandingContext } from '../App'; import { NavLink } from 'react-router-dom'; import { Home, LayoutGrid, Key, } from '../icons/commonIcons'; export type PageId = 'home' | 'models' | 'profile' | 'platform'; const navItems: { id: PageId; icon: any; label: string; path: string }[] = [ { id: 'home', icon: Home, label: '首页', path: '/' }, { id: 'models', icon: LayoutGrid, label: '模型广场', path: '/models' }, { id: 'platform', icon: Key, label: '开放平台', path: '/platform' }, ]; const Sidebar: React.FC = () => { const branding = useContext(BrandingContext); return ( <> {/* 桌面端侧边栏 */} {/* 移动端底部导航栏 */} {navItems.map((item) => ( `flex flex-col items-center justify-center px-2 py-1.5 rounded-lg transition-all min-w-0 flex-1 ${ isActive ? 'text-blue-600' : 'text-gray-400 hover:text-blue-600' }` } > {({ isActive }) => ( <> {item.label} > )} ))} > ); }; export default Sidebar;