import Link from "next/link"; import type { ReactNode } from "react"; const navigationItems = [ { href: "/", label: "总览" }, { href: "/messages", label: "留言" }, { href: "/devices", label: "设备" }, { href: "/activity", label: "活动" }, { href: "/scan", label: "扫码" }, ]; function isActivePath(currentPath: string, href: string) { if (href === "/") { return currentPath === "/"; } return currentPath === href || currentPath.startsWith(`${href}/`); } type PanelShellProps = { currentPath: string; title: string; description: string; caregiverToken: string; children: ReactNode; actions?: ReactNode; eyebrow?: string; }; export function PanelShell({ currentPath, title, description, caregiverToken, children, actions, eyebrow = "Digital Human Bridge", }: PanelShellProps) { return (
{navigationItems.map((item) => { const active = isActivePath(currentPath, item.href); return ( {item.label} ); })}

{eyebrow}

{title}

{description}

当前家属账号:{caregiverToken.slice(0, 8).toUpperCase()} 不同功能已拆到独立路径,消息支持单条直达
{actions ?
{actions}
: null}
{children}
); }