import Link from "next/link"; import type { ReactNode } from "react"; import { FileQuestion, Settings } from "lucide-react"; import type { ActiveNav } from "@/lib/nav/items"; import { buttonClass, focusRing } from "@/lib/ui/variants"; import { CommandSearchButton } from "./command/CommandPaletteMount"; import { LeftNav } from "./LeftNav"; import { NavDrawer } from "./NavDrawer"; import { ThemeToggle } from "./ThemeToggle"; interface AppShellProps { children: ReactNode; // 顶栏右侧的上下文信息(如作品名 / 进度)。 title?: string; subtitle?: string; // 项目内页给出 projectId → 左导航展开项目级入口(大纲/伏笔/审稿,UX §3.1)。 projectId?: string; // 当前激活的项目级入口键(用于高亮)。 activeNav?: ActiveNav; // 专注写作模式(P3-4):隐藏桌面左侧图标导航以加宽正文;顶栏汉堡/命令面板仍可达导航。 // 缺省 false → 其余页面外观不变(加法式可选项)。 hideNav?: boolean; } // 全局外壳:顶栏(64px) + 左导航 + 主区(UX §5.1)。 export function AppShell({ children, title, subtitle, projectId, activeNav, hideNav = false, }: AppShellProps) { return (
跳到正文
墨痕 {title ? ( {title} ) : null} {subtitle ? ( {subtitle} ) : null}
{hideNav ? null : }
{children}
); }