'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; const tabs = [ { href: '/manga', label: '推荐' }, { href: '/manga/search', label: '搜索' }, { href: '/manga/shelf', label: '书架' }, { href: '/manga/history', label: '历史' }, ]; export default function MangaSectionNav() { const pathname = usePathname(); return (
{tabs.map((tab) => { const active = pathname === tab.href; return ( {tab.label} ); })}
); }