{children}
import { useMemo } from 'react'; import { useRouter } from 'next/router'; import { Icon } from './icons'; const tabs = [ { href: '/', label: '首页', icon: 'home' }, { href: '/stats', label: '统计', icon: 'chart' }, { href: '/recurring', label: '周期', icon: 'repeat' }, { href: '/categories', label: '分类', icon: 'tags' }, ]; export default function AppShell({ title, subtitle, actions, headerContent, children, contentClassName = '', hideNav = false, compactHeader = false }) { const router = useRouter(); const activeTab = useMemo(() => { const matched = tabs.find((tab) => tab.href === router.pathname); return matched?.href || null; }, [router.pathname]); const headerNode = headerContent || (title ? (
{subtitle}
: null}