import React, { useState } from 'react'; import { Layout as AntLayout, Menu, ConfigProvider, theme, Drawer, Button } from 'antd'; import { RobotOutlined, MenuOutlined, AppstoreOutlined, EyeOutlined } from '@ant-design/icons'; import { useNavigate, useLocation } from 'react-router-dom'; import ParticleBackground from './ParticleBackground'; import { motion, AnimatePresence } from 'framer-motion'; const { Header, Content, Footer } = AntLayout; const Layout = ({ children }) => { const navigate = useNavigate(); const location = useLocation(); const [mobileMenuOpen, setMobileMenuOpen] = useState(false); const items = [ { key: '/', icon: , label: 'AI 硬件', }, { key: '/services', icon: , label: 'AI 服务', }, { key: '/ar', icon: , label: 'AR 体验', }, ]; const handleMenuClick = (key) => { navigate(key); setMobileMenuOpen(false); }; return (
navigate('/')} > Quant-Speed Logo {/* Desktop Menu */}
handleMenuClick(e.key)} style={{ background: 'transparent', borderBottom: 'none', minWidth: 300 }} />
{/* Mobile Menu Button */}
{/* Mobile Drawer Menu */} 导航菜单} placement="right" onClose={() => setMobileMenuOpen(false)} open={mobileMenuOpen} styles={{ body: { padding: 0, background: '#111' }, header: { background: '#111', borderBottom: '1px solid #333' }, wrapper: { width: 250 } }} > handleMenuClick(e.key)} style={{ background: 'transparent', borderRight: 'none' }} /> {children} ); }; export default Layout;