'use client'; import { StaticLink } from '@/components/ui/static-link'; import { usePathname } from 'next/navigation'; import { Home, Lightbulb, Package, FolderOpen, User } from 'lucide-react'; import { motion } from 'framer-motion'; import { cn } from '@/lib/utils'; // 关于页让位给案例页:转化路径上「看实证」优先于「看介绍」, // 关于/新闻等仍可通过汉堡抽屉(header)到达。 const tabs = [ { id: 'home', label: '首页', href: '/', icon: Home }, { id: 'products', label: '产品', href: '/products', icon: Package }, { id: 'solutions', label: '方案', href: '/solutions', icon: Lightbulb }, { id: 'cases', label: '案例', href: '/cases', icon: FolderOpen }, { id: 'contact', label: '联系', href: '/contact', icon: User }, ]; export function MobileTabBar() { const pathname = usePathname(); const isActive = (_href: string, id: string) => { if (id === 'home') { return pathname === '/'; } if (id === 'contact') { return pathname === '/contact'; } if (id === 'products') { return pathname === '/products' || pathname.startsWith('/products/'); } if (id === 'solutions') { return pathname === '/solutions' || pathname.startsWith('/solutions/'); } if (id === 'cases') { return pathname === '/cases' || pathname.startsWith('/cases/'); } return false; }; return ( ); }