import Link from "next/link"; import { ChevronLeft, Home, MessageCircle, Smartphone, UserRound } 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: "/settings", label: "我的", icon: UserRound }, ]; 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; backHref?: string; showTabs?: boolean; unreadCount?: number; }; export function PanelShell({ currentPath, title, description, caregiverLabel, children, actions, backHref, showTabs = !backHref, unreadCount = 0, }: PanelShellProps) { const initial = caregiverLabel.trim().slice(-1) || "安"; return (
{backHref ? (

{title}

{actions}
) : (

{title}

{description ?

{description}

: null}
{actions ?? ( {initial} )}
)} {children}
{showTabs ? ( ) : null}
); }