import Link from "next/link"; import { Home, MessageCircle, Smartphone, Activity, ScanLine, Settings, } from "lucide-react"; import type { ReactNode } from "react"; const navigationItems = [ { href: "/", label: "首页", icon: Home }, { href: "/messages", label: "留言", icon: MessageCircle }, { href: "/devices", label: "设备", icon: Smartphone }, { href: "/activity", label: "动态", icon: Activity }, { href: "/scan", label: "扫码", icon: ScanLine }, { href: "/settings", label: "设置", icon: Settings }, ]; function isActivePath(currentPath: string, href: string) { if (href === "/") { return currentPath === "/"; } return currentPath === href || currentPath.startsWith(`${href}/`); } type PanelShellProps = { currentPath: string; title: string; description: string; caregiverLabel: string; children: ReactNode; actions?: ReactNode; eyebrow?: string; }; export function PanelShell({ currentPath, title, description, caregiverLabel, children, actions, eyebrow = "家人连线", }: PanelShellProps) { return (
{navigationItems.map((item) => { const active = isActivePath(currentPath, item.href); const Icon = item.icon; return ( {item.label} ); })}

{eyebrow}

{title}

{description}

账号:{caregiverLabel}
{actions ?
{actions}
: null}
{children}
); }