{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "inset-shell",
  "type": "registry:block",
  "title": "Inset Shell",
  "description": "The frame an app lives in: a sidebar with workspace switcher, nav, colour-dotted projects and an account menu that folds down to an icon rail, beside a rounded inset page with live breadcrumbs and a floating drawer on phones.",
  "categories": [
    "screen",
    "Shells"
  ],
  "dependencies": [
    "motion",
    "lucide-react"
  ],
  "registryDependencies": [
    "utils",
    "https://coss.com/ui/r/avatar.json",
    "https://coss.com/ui/r/badge.json",
    "https://coss.com/ui/r/breadcrumb.json",
    "https://coss.com/ui/r/button.json",
    "https://coss.com/ui/r/kbd.json",
    "https://coss.com/ui/r/menu.json",
    "https://coss.com/ui/r/tooltip.json"
  ],
  "files": [
    {
      "path": "registry/devl/inset-shell.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport { AnimatePresence, LayoutGroup, MotionConfig, motion } from \"motion/react\";\nimport {\n  BellIcon,\n  CalendarIcon,\n  ChartColumnIcon,\n  CheckIcon,\n  ChevronDownIcon,\n  ChevronRightIcon,\n  ChevronsUpDownIcon,\n  CircleDotIcon,\n  FileTextIcon,\n  HouseIcon,\n  InboxIcon,\n  KeyboardIcon,\n  LayoutGridIcon,\n  LifeBuoyIcon,\n  LogOutIcon,\n  type LucideIcon,\n  MenuIcon,\n  PanelLeftIcon,\n  PlusIcon,\n  SearchIcon,\n  SettingsIcon,\n  Share2Icon,\n  UserRoundIcon,\n  XIcon,\n} from \"lucide-react\";\nimport { type ReactElement, type ReactNode, useEffect, useId, useRef, useState } from \"react\";\nimport { Avatar, AvatarFallback } from \"@/components/ui/avatar\";\nimport { Badge } from \"@/components/ui/badge\";\nimport {\n  Breadcrumb,\n  BreadcrumbLink,\n  BreadcrumbList,\n  BreadcrumbPage,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { Kbd } from \"@/components/ui/kbd\";\nimport {\n  Menu,\n  MenuGroup,\n  MenuGroupLabel,\n  MenuItem,\n  MenuPopup,\n  MenuRadioGroup,\n  MenuRadioItem,\n  MenuSeparator,\n  MenuShortcut,\n  MenuTrigger,\n} from \"@/components/ui/menu\";\nimport { Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger } from \"@/components/ui/tooltip\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ShellTone = \"orange\" | \"teal\" | \"cyan\" | \"violet\" | \"rose\" | \"info\" | \"success\" | \"warning\";\n\nexport interface ShellWorkspace {\n  id: string;\n  name: string;\n  plan: string;\n  initials: string;\n  tone: ShellTone;\n}\n\nexport interface ShellNavItem {\n  id: string;\n  label: string;\n  icon: LucideIcon;\n  count?: number;\n}\n\nexport interface ShellProject {\n  id: string;\n  name: string;\n  tone: ShellTone;\n  open?: number;\n}\n\nexport interface ShellUser {\n  name: string;\n  email: string;\n  initials: string;\n}\n\nexport interface InsetShellProps {\n  workspaces?: ShellWorkspace[];\n  nav?: ShellNavItem[];\n  projects?: ShellProject[];\n  user?: ShellUser;\n  breadcrumbs?: string[];\n  defaultCollapsed?: boolean;\n  children?: ReactNode;\n  className?: string;\n}\n\nconst dot: Record<ShellTone, string> = {\n  \"orange\": \"bg-orange-500\",\n  \"teal\": \"bg-teal-500\",\n  \"cyan\": \"bg-cyan-500\",\n  \"violet\": \"bg-violet-500\",\n  \"rose\": \"bg-rose-500\",\n  info: \"bg-info\",\n  success: \"bg-success\",\n  warning: \"bg-warning\",\n};\n\nconst tile: Record<ShellTone, string> = {\n  \"orange\": \"bg-orange-700\",\n  \"teal\": \"bg-teal-700\",\n  \"cyan\": \"bg-cyan-700\",\n  \"violet\": \"bg-violet-600\",\n  \"rose\": \"bg-rose-700\",\n  info: \"bg-blue-600\",\n  success: \"bg-emerald-700\",\n  warning: \"bg-amber-700\",\n};\n\nconst soft: Record<ShellTone, string> = {\n  orange: \"bg-orange-500/14\",\n  teal: \"bg-teal-500/14\",\n  cyan: \"bg-cyan-500/14\",\n  violet: \"bg-violet-500/14\",\n  rose: \"bg-rose-500/14\",\n  info: \"bg-info/14\",\n  success: \"bg-success/14\",\n  warning: \"bg-warning/14\",\n};\n\nconst spring = { type: \"spring\", stiffness: 420, damping: 36 } as const;\nconst widthSpring = { type: \"spring\", stiffness: 380, damping: 38 } as const;\n\nconst defaultWorkspaces: ShellWorkspace[] = [\n  { id: \"northwind\", name: \"Northwind Labs\", plan: \"Team\", initials: \"NL\", tone: \"info\" },\n  { id: \"fable\", name: \"Fable & Co\", plan: \"Free\", initials: \"FC\", tone: \"orange\" },\n  { id: \"pilot\", name: \"Pilot Studio\", plan: \"Business\", initials: \"PS\", tone: \"teal\" },\n];\n\nconst defaultNav: ShellNavItem[] = [\n  { id: \"home\", label: \"Home\", icon: HouseIcon },\n  { id: \"inbox\", label: \"Inbox\", icon: InboxIcon, count: 4 },\n  { id: \"issues\", label: \"My issues\", icon: CircleDotIcon, count: 6 },\n  { id: \"projects\", label: \"Projects\", icon: LayoutGridIcon },\n  { id: \"docs\", label: \"Docs\", icon: FileTextIcon },\n  { id: \"reports\", label: \"Reports\", icon: ChartColumnIcon },\n];\n\nconst defaultProjects: ShellProject[] = [\n  { id: \"atlas\", name: \"Atlas redesign\", tone: \"orange\", open: 24 },\n  { id: \"billing\", name: \"Billing v2\", tone: \"teal\", open: 9 },\n  { id: \"mobile\", name: \"Mobile beta\", tone: \"info\", open: 17 },\n  { id: \"growth\", name: \"Growth experiments\", tone: \"violet\", open: 6 },\n  { id: \"infra\", name: \"Infra hardening\", tone: \"rose\", open: 3 },\n];\n\nconst defaultUser: ShellUser = { name: \"Ines Moreau\", email: \"ines@northwind.dev\", initials: \"IM\" };\n\nfunction SidebarRow({\n  collapsed,\n  label,\n  tip,\n  children,\n}: {\n  collapsed: boolean;\n  label: string;\n  tip?: ReactNode;\n  children: (props: { \"aria-label\"?: string }) => ReactNode;\n}) {\n  return (\n    <Tooltip disabled={!collapsed}>\n      <TooltipTrigger render={children({ \"aria-label\": collapsed ? label : undefined }) as ReactElement} />\n      <TooltipPopup side=\"right\" sideOffset={10}>\n        {tip ?? label}\n      </TooltipPopup>\n    </Tooltip>\n  );\n}\n\nfunction Label({ collapsed, children, className }: { collapsed: boolean; children: ReactNode; className?: string }) {\n  return (\n    <span\n      aria-hidden={collapsed || undefined}\n      className={cn(\n        \"min-w-0 truncate transition-[opacity,translate] duration-200\",\n        collapsed && \"pointer-events-none -translate-x-1 opacity-0\",\n        className,\n      )}\n    >\n      {children}\n    </span>\n  );\n}\n\ninterface SidebarProps {\n  collapsed: boolean;\n  workspaces: ShellWorkspace[];\n  workspace: string;\n  onWorkspace: (id: string) => void;\n  nav: ShellNavItem[];\n  active: string;\n  onNavigate: (id: string, label: string) => void;\n  projects: ShellProject[];\n  user: ShellUser;\n  onClose?: () => void;\n}\n\nfunction SidebarBody({\n  collapsed,\n  workspaces,\n  workspace,\n  onWorkspace,\n  nav,\n  active,\n  onNavigate,\n  projects,\n  user,\n  onClose,\n}: SidebarProps) {\n  const [projectsOpen, setProjectsOpen] = useState(true);\n  const ws = workspaces.find((w) => w.id === workspace) ?? workspaces[0];\n  const pill = useId();\n  const row =\n    \"group/row relative flex h-8 w-full cursor-pointer items-center gap-2.5 overflow-hidden rounded-lg px-3 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring\";\n\n  return (\n    <LayoutGroup id={pill}>\n      <div className=\"flex h-full min-h-0 flex-col whitespace-nowrap\">\n        <div className=\"flex items-center gap-1 p-2\">\n          <Menu>\n            <MenuTrigger\n              aria-label={`Workspace: ${ws.name}`}\n              className=\"flex h-11 min-w-0 flex-1 cursor-pointer items-center gap-2.5 overflow-hidden rounded-xl px-1.5 text-left outline-none transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring data-popup-open:bg-accent\"\n            >\n              <span\n                className={cn(\n                  \"flex size-7 shrink-0 items-center justify-center rounded-lg font-semibold text-[11px] text-white\",\n                  tile[ws.tone],\n                )}\n              >\n                {ws.initials}\n              </span>\n              <span className={cn(\"flex min-w-0 flex-1 flex-col transition-opacity duration-200\", collapsed && \"opacity-0\")}>\n                <span className=\"truncate font-medium leading-tight\">{ws.name}</span>\n                <span className=\"truncate text-muted-foreground text-xs leading-tight\">{ws.plan} plan</span>\n              </span>\n              <ChevronsUpDownIcon className={cn(\"size-4 shrink-0 text-muted-foreground\", collapsed && \"opacity-0\")} />\n            </MenuTrigger>\n            <MenuPopup align=\"start\" className=\"w-60\">\n              <MenuGroup>\n                <MenuGroupLabel>Workspaces</MenuGroupLabel>\n                <MenuRadioGroup onValueChange={(v) => onWorkspace(v as string)} value={workspace}>\n                  {workspaces.map((w) => (\n                    <MenuRadioItem key={w.id} value={w.id}>\n                      <span className=\"flex items-center gap-2\">\n                        <span className={cn(\"size-2 rounded-full\", tile[w.tone])} />\n                        {w.name}\n                        <span className=\"text-muted-foreground text-xs\">{w.plan}</span>\n                      </span>\n                    </MenuRadioItem>\n                  ))}\n                </MenuRadioGroup>\n              </MenuGroup>\n              <MenuSeparator />\n              <MenuItem>\n                <PlusIcon />\n                Create workspace\n              </MenuItem>\n              <MenuItem>\n                <SettingsIcon />\n                Workspace settings\n              </MenuItem>\n            </MenuPopup>\n          </Menu>\n          {onClose && (\n            <Button aria-label=\"Close navigation\" onClick={onClose} size=\"icon-sm\" variant=\"ghost\">\n              <XIcon />\n            </Button>\n          )}\n        </div>\n\n        <div className=\"px-2 pb-2\">\n          <SidebarRow collapsed={collapsed} label=\"Search\" tip={<span>Search <Kbd className=\"ms-1\">⌘K</Kbd></span>}>\n            {(a) => (\n              <button\n                {...a}\n                className={cn(\n                  row,\n                  \"border bg-background text-muted-foreground shadow-xs/5 hover:text-foreground dark:bg-input/32\",\n                  collapsed && \"border-transparent bg-transparent shadow-none dark:bg-transparent\",\n                )}\n                type=\"button\"\n              >\n                <SearchIcon className=\"size-4 shrink-0\" />\n                <Label collapsed={collapsed}>Search</Label>\n                <Kbd className={cn(\"ms-auto transition-opacity\", collapsed && \"opacity-0\")}>⌘K</Kbd>\n              </button>\n            )}\n          </SidebarRow>\n        </div>\n\n        <div className=\"min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-2 [scrollbar-width:thin]\">\n          <nav aria-label=\"Primary\" className=\"flex flex-col gap-0.5\">\n            {nav.map((n) => {\n              const on = active === n.id;\n              return (\n                <SidebarRow collapsed={collapsed} key={n.id} label={n.label}>\n                  {(a) => (\n                    <button\n                      {...a}\n                      aria-current={on ? \"page\" : undefined}\n                      className={cn(row, on ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\")}\n                      onClick={() => onNavigate(n.id, n.label)}\n                      type=\"button\"\n                    >\n                      {on && (\n                        <motion.span\n                          className=\"absolute inset-0 rounded-lg bg-background shadow-xs/5 ring-1 ring-border dark:bg-accent dark:ring-0\"\n                          layoutId=\"shell-nav-pill\"\n                          transition={spring}\n                        />\n                      )}\n                      {!on && <span className=\"absolute inset-0 rounded-lg transition-colors group-hover/row:bg-accent\" />}\n                      <n.icon className=\"relative size-4 shrink-0\" />\n                      <Label className=\"relative font-medium\" collapsed={collapsed}>\n                        {n.label}\n                      </Label>\n                      {n.count !== undefined && (\n                        <span\n                          className={cn(\n                            \"relative ms-auto rounded-full px-1.5 text-xs tabular-nums transition-opacity\",\n                            n.id === \"inbox\" ? \"bg-info/12 font-medium text-info-foreground\" : \"text-muted-foreground\",\n                            collapsed && \"opacity-0\",\n                          )}\n                        >\n                          {n.count}\n                        </span>\n                      )}\n                      {collapsed && n.id === \"inbox\" && (\n                        <span className=\"absolute top-1.5 left-7 size-1.5 rounded-full bg-info ring-2 ring-sidebar\" />\n                      )}\n                    </button>\n                  )}\n                </SidebarRow>\n              );\n            })}\n          </nav>\n\n          <div className=\"mt-5\">\n            <div className=\"relative flex h-7 items-center px-3\">\n              <button\n                aria-expanded={projectsOpen}\n                className={cn(\n                  \"flex cursor-pointer items-center gap-1 rounded font-medium text-muted-foreground text-xs outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring\",\n                  collapsed && \"pointer-events-none opacity-0\",\n                )}\n                onClick={() => setProjectsOpen((o) => !o)}\n                tabIndex={collapsed ? -1 : 0}\n                type=\"button\"\n              >\n                Projects\n                <ChevronDownIcon\n                  className={cn(\"size-3 transition-transform duration-200\", !projectsOpen && \"-rotate-90\")}\n                />\n              </button>\n              {collapsed && <span className=\"absolute left-4 h-px w-6 bg-border\" />}\n              <Button\n                aria-label=\"New project\"\n                className={cn(\"ms-auto\", collapsed && \"pointer-events-none opacity-0\")}\n                size=\"icon-xs\"\n                tabIndex={collapsed ? -1 : 0}\n                variant=\"ghost\"\n              >\n                <PlusIcon />\n              </Button>\n            </div>\n            <AnimatePresence initial={false}>\n              {(projectsOpen || collapsed) && (\n                <motion.ul\n                  animate={{ height: \"auto\", opacity: 1 }}\n                  className=\"flex flex-col gap-0.5 overflow-hidden\"\n                  exit={{ height: 0, opacity: 0 }}\n                  initial={{ height: 0, opacity: 0 }}\n                  transition={spring}\n                >\n                  {projects.map((p) => {\n                    const on = active === `project-${p.id}`;\n                    return (\n                      <li key={p.id}>\n                        <SidebarRow collapsed={collapsed} label={p.name}>\n                          {(a) => (\n                            <button\n                              {...a}\n                              aria-current={on ? \"page\" : undefined}\n                              className={cn(row, on ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\")}\n                              onClick={() => onNavigate(`project-${p.id}`, p.name)}\n                              type=\"button\"\n                            >\n                              {on && (\n                                <motion.span\n                                  className=\"absolute inset-0 rounded-lg bg-background shadow-xs/5 ring-1 ring-border dark:bg-accent dark:ring-0\"\n                                  layoutId=\"shell-nav-pill\"\n                                  transition={spring}\n                                />\n                              )}\n                              {!on && (\n                                <span className=\"absolute inset-0 rounded-lg transition-colors group-hover/row:bg-accent\" />\n                              )}\n                              <span className=\"relative flex size-4 shrink-0 items-center justify-center\">\n                                <span className={cn(\"size-2 rounded-full ring-3 ring-current/0\", dot[p.tone])} />\n                              </span>\n                              <Label className=\"relative\" collapsed={collapsed}>\n                                {p.name}\n                              </Label>\n                              {p.open !== undefined && (\n                                <span\n                                  className={cn(\n                                    \"relative ms-auto text-muted-foreground text-xs tabular-nums opacity-0 transition-opacity group-hover/row:opacity-100\",\n                                    on && \"opacity-100\",\n                                    collapsed && \"opacity-0!\",\n                                  )}\n                                >\n                                  {p.open}\n                                </span>\n                              )}\n                            </button>\n                          )}\n                        </SidebarRow>\n                      </li>\n                    );\n                  })}\n                </motion.ul>\n              )}\n            </AnimatePresence>\n          </div>\n        </div>\n\n        <div className=\"flex flex-col gap-0.5 p-2\">\n          <SidebarRow collapsed={collapsed} label=\"Help & support\">\n            {(a) => (\n              <button {...a} className={cn(row, \"text-muted-foreground hover:bg-accent hover:text-foreground\")} type=\"button\">\n                <LifeBuoyIcon className=\"size-4 shrink-0\" />\n                <Label collapsed={collapsed}>Help &amp; support</Label>\n              </button>\n            )}\n          </SidebarRow>\n          <Menu>\n            <MenuTrigger\n              aria-label={`Account: ${user.name}`}\n              className=\"mt-1 flex h-12 w-full cursor-pointer items-center gap-2.5 overflow-hidden rounded-xl px-1.5 text-left outline-none transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring data-popup-open:bg-accent\"\n            >\n              <Avatar className=\"size-7 shrink-0\">\n                <AvatarFallback className=\"bg-teal-500/16 text-[11px] text-teal-800 dark:text-teal-400\">{user.initials}</AvatarFallback>\n              </Avatar>\n              <span className={cn(\"flex min-w-0 flex-1 flex-col transition-opacity duration-200\", collapsed && \"opacity-0\")}>\n                <span className=\"truncate font-medium leading-tight\">{user.name}</span>\n                <span className=\"truncate text-muted-foreground text-xs leading-tight\">{user.email}</span>\n              </span>\n              <ChevronsUpDownIcon className={cn(\"size-4 shrink-0 text-muted-foreground\", collapsed && \"opacity-0\")} />\n            </MenuTrigger>\n            <MenuPopup align=\"start\" className=\"w-56\" side=\"top\">\n              <div className=\"flex items-center gap-2.5 px-2 py-1.5\">\n                <Avatar className=\"size-8\">\n                  <AvatarFallback className=\"bg-teal-500/16 text-teal-800 dark:text-teal-400 text-xs\">{user.initials}</AvatarFallback>\n                </Avatar>\n                <div className=\"min-w-0\">\n                  <div className=\"truncate font-medium text-sm\">{user.name}</div>\n                  <div className=\"truncate text-muted-foreground text-xs\">{user.email}</div>\n                </div>\n              </div>\n              <MenuSeparator />\n              <MenuItem>\n                <UserRoundIcon />\n                Profile\n              </MenuItem>\n              <MenuItem>\n                <SettingsIcon />\n                Preferences\n                <MenuShortcut>⌘,</MenuShortcut>\n              </MenuItem>\n              <MenuItem>\n                <KeyboardIcon />\n                Shortcuts\n                <MenuShortcut>?</MenuShortcut>\n              </MenuItem>\n              <MenuSeparator />\n              <MenuItem>\n                <LogOutIcon />\n                Sign out\n              </MenuItem>\n            </MenuPopup>\n          </Menu>\n        </div>\n      </div>\n    </LayoutGroup>\n  );\n}\n\ntype Status = \"on-track\" | \"at-risk\" | \"done\";\n\ninterface ProjectDetail {\n  summary: string;\n  status: Status;\n  progress: number;\n  week: number;\n  open: number;\n  total: number;\n  target: string;\n  targetIn: string;\n  targetNote: string;\n  milestones: { name: string; date: string; done: number }[];\n  updates: { who: string; what: string; target: string; to?: string; time: string }[];\n}\n\nconst people: Record<string, { initials: string; tone: string }> = {\n  \"Kai Tanaka\": { initials: \"KT\", tone: \"bg-blue-500/14 text-blue-700 dark:text-blue-300\" },\n  \"Rosa Lind\": { initials: \"RL\", tone: \"bg-orange-500/14 text-orange-700 dark:text-orange-300\" },\n  \"Ines Moreau\": { initials: \"IM\", tone: \"bg-teal-500/16 text-teal-700 dark:text-teal-300\" },\n  \"Theo Brandt\": { initials: \"TB\", tone: \"bg-violet-500/16 text-violet-700 dark:text-violet-300\" },\n};\n\nconst details: Record<string, ProjectDetail> = {\n  atlas: {\n    summary: \"A calmer navigation model for Orbit: fewer top-level items, projects one click away, and a sidebar that gets out of the way.\",\n    status: \"on-track\",\n    progress: 68,\n    week: 9,\n    open: 24,\n    total: 76,\n    target: \"Nov 14\",\n    targetIn: \"in 21 days\",\n    targetNote: \"Beta review with 50 teams\",\n    milestones: [\n      { name: \"Research synthesis\", date: \"Oct 4\", done: 100 },\n      { name: \"Navigation & IA\", date: \"Oct 22\", done: 82 },\n      { name: \"Component audit\", date: \"Nov 3\", done: 46 },\n      { name: \"Beta to 50 teams\", date: \"Nov 14\", done: 12 },\n    ],\n    updates: [\n      { who: \"Kai Tanaka\", what: \"moved\", target: \"Sidebar density pass\", to: \"In review\", time: \"12m\" },\n      { who: \"Rosa Lind\", what: \"commented on\", target: \"Breadcrumb overflow\", time: \"48m\" },\n      { who: \"Ines Moreau\", what: \"closed\", target: \"Empty states for projects\", time: \"2h\" },\n      { who: \"Theo Brandt\", what: \"added\", target: \"Keyboard map for nav\", to: \"Backlog\", time: \"3h\" },\n    ],\n  },\n  billing: {\n    summary: \"Usage-based pricing with prorated seat changes, a clearer invoice and fewer failed renewals.\",\n    status: \"at-risk\",\n    progress: 41,\n    week: 3,\n    open: 9,\n    total: 22,\n    target: \"Dec 2\",\n    targetIn: \"in 39 days\",\n    targetNote: \"Migrate the first 200 workspaces\",\n    milestones: [\n      { name: \"Pricing model sign-off\", date: \"Oct 1\", done: 100 },\n      { name: \"Proration engine\", date: \"Oct 28\", done: 64 },\n      { name: \"Invoice redesign\", date: \"Nov 12\", done: 20 },\n      { name: \"Staged migration\", date: \"Dec 2\", done: 0 },\n    ],\n    updates: [\n      { who: \"Theo Brandt\", what: \"flagged\", target: \"Tax rounding for EU\", to: \"Blocked\", time: \"25m\" },\n      { who: \"Ines Moreau\", what: \"moved\", target: \"Retry failed charges\", to: \"In progress\", time: \"1h\" },\n      { who: \"Kai Tanaka\", what: \"closed\", target: \"Seat count webhook\", time: \"4h\" },\n    ],\n  },\n  mobile: {\n    summary: \"A native iOS and Android app for triage on the go: inbox, quick replies and push for mentions.\",\n    status: \"on-track\",\n    progress: 55,\n    week: 6,\n    open: 17,\n    total: 38,\n    target: \"Nov 28\",\n    targetIn: \"in 35 days\",\n    targetNote: \"TestFlight to 400 testers\",\n    milestones: [\n      { name: \"Navigation shell\", date: \"Oct 10\", done: 100 },\n      { name: \"Inbox and replies\", date: \"Nov 1\", done: 70 },\n      { name: \"Push notifications\", date: \"Nov 18\", done: 30 },\n      { name: \"Public beta\", date: \"Nov 28\", done: 0 },\n    ],\n    updates: [\n      { who: \"Rosa Lind\", what: \"shipped\", target: \"Swipe to archive\", time: \"40m\" },\n      { who: \"Kai Tanaka\", what: \"commented on\", target: \"Offline drafts\", time: \"2h\" },\n      { who: \"Theo Brandt\", what: \"moved\", target: \"Deep links\", to: \"In review\", time: \"5h\" },\n    ],\n  },\n  growth: {\n    summary: \"Small weekly bets on activation: a shorter signup, a guided first project and better invite emails.\",\n    status: \"on-track\",\n    progress: 30,\n    week: 4,\n    open: 6,\n    total: 14,\n    target: \"Dec 15\",\n    targetIn: \"in 52 days\",\n    targetNote: \"Lift week-one activation to 45%\",\n    milestones: [\n      { name: \"Signup in two steps\", date: \"Oct 18\", done: 100 },\n      { name: \"Guided first project\", date: \"Nov 8\", done: 35 },\n      { name: \"Invite email tests\", date: \"Nov 25\", done: 10 },\n      { name: \"Readout\", date: \"Dec 15\", done: 0 },\n    ],\n    updates: [\n      { who: \"Ines Moreau\", what: \"started\", target: \"Invite subject line test\", time: \"1h\" },\n      { who: \"Rosa Lind\", what: \"closed\", target: \"Remove company size field\", time: \"1d\" },\n    ],\n  },\n  infra: {\n    summary: \"Fewer pages at night: faster deploy rollbacks, regional failover for the API and saner alert thresholds.\",\n    status: \"done\",\n    progress: 92,\n    week: 5,\n    open: 3,\n    total: 41,\n    target: \"Oct 31\",\n    targetIn: \"in 7 days\",\n    targetNote: \"Failover drill with on-call\",\n    milestones: [\n      { name: \"One-click rollback\", date: \"Sep 20\", done: 100 },\n      { name: \"Alert threshold review\", date: \"Oct 6\", done: 100 },\n      { name: \"Regional failover\", date: \"Oct 24\", done: 100 },\n      { name: \"Failover drill\", date: \"Oct 31\", done: 60 },\n    ],\n    updates: [\n      { who: \"Kai Tanaka\", what: \"closed\", target: \"Failover for eu-west\", time: \"3h\" },\n      { who: \"Theo Brandt\", what: \"scheduled\", target: \"Drill with on-call\", to: \"Oct 31\", time: \"6h\" },\n    ],\n  },\n};\n\nconst statusBadge: Record<Status, { label: string; variant: \"success\" | \"warning\" | \"info\" }> = {\n  \"on-track\": { label: \"On track\", variant: \"success\" },\n  \"at-risk\": { label: \"At risk\", variant: \"warning\" },\n  done: { label: \"Wrapping up\", variant: \"info\" },\n};\n\nconst ease = [0.23, 1, 0.32, 1] as const;\n\nconst owners: Record<string, { lead: string; start: string; team: string }> = {\n  atlas: { lead: \"Kai Tanaka\", start: \"Sep 8\", team: \"Design\" },\n  billing: { lead: \"Theo Brandt\", start: \"Sep 15\", team: \"Payments\" },\n  mobile: { lead: \"Rosa Lind\", start: \"Sep 1\", team: \"Mobile\" },\n  growth: { lead: \"Ines Moreau\", start: \"Oct 6\", team: \"Growth\" },\n  infra: { lead: \"Kai Tanaka\", start: \"Aug 25\", team: \"Platform\" },\n};\n\nfunction PersonDot({ name, className }: { name: string; className?: string }) {\n  return (\n    <Avatar className={cn(\"size-5\", className)}>\n      <AvatarFallback className={cn(\"font-medium text-[9px]\", people[name]?.tone)}>{people[name]?.initials}</AvatarFallback>\n    </Avatar>\n  );\n}\n\nfunction ProgressRing({ value, tone }: { value: number; tone: ShellTone }) {\n  const r = 6;\n  const c = 2 * Math.PI * r;\n  return (\n    <svg aria-hidden className=\"size-4 -rotate-90\" viewBox=\"0 0 16 16\">\n      <circle className=\"stroke-muted\" cx=\"8\" cy=\"8\" fill=\"none\" r={r} strokeWidth=\"2.5\" />\n      <motion.circle\n        animate={{ strokeDashoffset: c * (1 - value / 100) }}\n        className={ringTone[tone]}\n        cx=\"8\"\n        cy=\"8\"\n        fill=\"none\"\n        initial={{ strokeDashoffset: c }}\n        r={r}\n        strokeDasharray={c}\n        strokeLinecap=\"round\"\n        strokeWidth=\"2.5\"\n        transition={{ duration: 0.6, ease, delay: 0.1 }}\n      />\n    </svg>\n  );\n}\n\nconst ringTone: Record<ShellTone, string> = {\n  orange: \"stroke-orange-500\",\n  teal: \"stroke-teal-500\",\n  cyan: \"stroke-cyan-500\",\n  violet: \"stroke-violet-500\",\n  rose: \"stroke-rose-500\",\n  info: \"stroke-info\",\n  success: \"stroke-success\",\n  warning: \"stroke-warning\",\n};\n\nfunction Properties({ project, d, className }: { project: ShellProject; d: ProjectDetail; className?: string }) {\n  const o = owners[project.id] ?? owners.atlas;\n  const badge = statusBadge[d.status];\n  const members = Array.from(new Set([o.lead, ...d.updates.map((u) => u.who)]));\n  const row = \"flex min-h-8 items-center gap-2\";\n  return (\n    <dl className={cn(\"grid grid-cols-[88px_minmax(0,1fr)] gap-x-3 gap-y-1 text-sm\", className)}>\n      <dt className={cn(row, \"text-muted-foreground text-xs\")}>Status</dt>\n      <dd className={row}>\n        <Badge variant={badge.variant}>{badge.label}</Badge>\n      </dd>\n      <dt className={cn(row, \"text-muted-foreground text-xs\")}>Lead</dt>\n      <dd className={cn(row, \"min-w-0\")}>\n        <PersonDot name={o.lead} />\n        <span className=\"truncate\">{o.lead}</span>\n      </dd>\n      <dt className={cn(row, \"text-muted-foreground text-xs\")}>Members</dt>\n      <dd className={row}>\n        <span className=\"flex -space-x-1\">\n          {members.map((m) => (\n            <PersonDot className=\"bg-background ring-2 ring-background\" key={m} name={m} />\n          ))}\n        </span>\n        <span className=\"text-muted-foreground text-xs tabular-nums\">{members.length}</span>\n      </dd>\n      <dt className={cn(row, \"text-muted-foreground text-xs\")}>Dates</dt>\n      <dd className={cn(row, \"tabular-nums\")}>\n        <CalendarIcon className=\"size-3.5 text-muted-foreground\" />\n        {o.start}\n        <ChevronRightIcon className=\"size-3 text-muted-foreground\" />\n        {d.target}\n      </dd>\n      <dt className={cn(row, \"text-muted-foreground text-xs\")}>Team</dt>\n      <dd className={row}>\n        <span className=\"inline-flex h-6 items-center gap-1.5 rounded-md border px-2 text-xs\">\n          <span className={cn(\"size-1.5 rounded-full\", dot[project.tone])} />\n          {o.team}\n        </span>\n      </dd>\n    </dl>\n  );\n}\n\nfunction ProjectOverview({ project }: { project: ShellProject }) {\n  const d = details[project.id] ?? details.atlas;\n  const [tab, setTab] = useState(\"overview\");\n  const tabId = useId();\n  const tabs = [\n    { id: \"overview\", label: \"Overview\" },\n    { id: \"issues\", label: \"Issues\", count: d.open },\n    { id: \"docs\", label: \"Docs\", count: d.milestones.length + 3 },\n    { id: \"activity\", label: \"Activity\" },\n  ];\n  const closed = d.total - d.open;\n  return (\n    <div className=\"mx-auto flex w-full max-w-5xl gap-10 px-4 py-6 @3xl:px-8 @3xl:py-8\">\n      <div className=\"flex min-w-0 flex-1 flex-col gap-6\">\n        <div className=\"flex flex-col gap-2\">\n          <span className={cn(\"flex size-8 items-center justify-center rounded-lg\", soft[project.tone])}>\n            <span className={cn(\"size-2.5 rounded-full\", dot[project.tone])} />\n          </span>\n          <h1 className=\"mt-2 text-balance font-heading font-semibold text-2xl tracking-tight\">{project.name}</h1>\n          <p className=\"max-w-xl text-pretty text-muted-foreground\">{d.summary}</p>\n        </div>\n\n        <Properties className=\"rounded-xl border bg-card px-4 py-3 @4xl:hidden\" d={d} project={project} />\n\n        <LayoutGroup id={tabId}>\n          <div className=\"flex gap-1 overflow-x-auto border-b [scrollbar-width:none]\" role=\"tablist\">\n            {tabs.map((t) => (\n              <button\n                aria-selected={tab === t.id}\n                className={cn(\n                  \"relative flex h-9 shrink-0 cursor-pointer items-center gap-1.5 px-2.5 font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n                  tab === t.id ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\",\n                )}\n                key={t.id}\n                onClick={() => setTab(t.id)}\n                role=\"tab\"\n                type=\"button\"\n              >\n                {t.label}\n                {t.count !== undefined && <span className=\"text-muted-foreground text-xs tabular-nums\">{t.count}</span>}\n                {tab === t.id && (\n                  <motion.span className=\"absolute inset-x-1 -bottom-px h-0.5 rounded-full bg-foreground\" layoutId=\"tab\" transition={spring} />\n                )}\n              </button>\n            ))}\n          </div>\n        </LayoutGroup>\n\n        <section className=\"flex flex-col gap-3\">\n          <div className=\"flex items-baseline justify-between gap-3\">\n            <h2 className=\"font-medium\">Progress</h2>\n            <span className=\"text-muted-foreground text-xs tabular-nums\">\n              <span className=\"text-success-foreground\">+{d.week}%</span> this week\n            </span>\n          </div>\n          <div className=\"flex items-center gap-3\">\n            <div className=\"h-1.5 flex-1 overflow-hidden rounded-full bg-muted\">\n              <motion.div\n                animate={{ scaleX: d.progress / 100 }}\n                className={cn(\"h-full origin-left rounded-full\", dot[project.tone])}\n                initial={{ scaleX: 0 }}\n                key={project.id}\n                transition={{ duration: 0.6, ease, delay: 0.1 }}\n              />\n            </div>\n            <span className=\"w-10 text-right font-medium tabular-nums\">{d.progress}%</span>\n          </div>\n          <div className=\"flex flex-wrap gap-x-5 gap-y-1 text-muted-foreground text-xs tabular-nums\">\n            <span>\n              <span className=\"font-medium text-foreground\">{closed}</span> done\n            </span>\n            <span>\n              <span className=\"font-medium text-foreground\">{d.open}</span> open\n            </span>\n            <span>\n              Target <span className=\"font-medium text-foreground\">{d.target}</span> · {d.targetIn}\n            </span>\n          </div>\n        </section>\n\n        <section className=\"flex flex-col gap-2\">\n          <div className=\"flex items-center justify-between\">\n            <h2 className=\"font-medium\">Milestones</h2>\n            <Button className=\"-me-2\" size=\"xs\" variant=\"ghost\">\n              <PlusIcon />\n              Add\n            </Button>\n          </div>\n          <ul className=\"divide-y rounded-xl border bg-card\">\n            {d.milestones.map((m) => {\n              const done = m.done === 100;\n              return (\n                <li className=\"flex h-11 items-center gap-3 px-3.5\" key={m.name}>\n                  <span\n                    aria-label={done ? \"Complete\" : `${m.done}% complete`}\n                    className={cn(\n                      \"size-2.5 shrink-0 rotate-45 rounded-[calc(var(--radius)*0.2)] border\",\n                      done ? \"border-success bg-success\" : m.done > 0 ? cn(\"border-transparent\", dot[project.tone]) : \"border-muted-foreground/50\",\n                    )}\n                    role=\"img\"\n                  />\n                  <span className={cn(\"min-w-0 flex-1 truncate\", done && \"text-muted-foreground\")}>{m.name}</span>\n                  <span className=\"w-10 text-right text-muted-foreground text-xs tabular-nums\">{m.done}%</span>\n                  <span className=\"w-14 text-right text-muted-foreground text-xs tabular-nums\">{m.date}</span>\n                </li>\n              );\n            })}\n          </ul>\n        </section>\n\n        <section className=\"flex flex-col gap-3\">\n          <h2 className=\"font-medium\">Latest updates</h2>\n          <ul className=\"relative flex flex-col gap-4 before:absolute before:top-3 before:bottom-3 before:left-[9.5px] before:w-px before:bg-border\">\n            {d.updates.map((u) => (\n              <li className=\"relative flex gap-3\" key={u.target}>\n                <PersonDot className=\"bg-background ring-4 ring-background\" name={u.who} />\n                <p className=\"min-w-0 flex-1 text-pretty text-muted-foreground leading-5\">\n                  <span className=\"font-medium text-foreground\">{u.who}</span> {u.what}{\" \"}\n                  <span className=\"text-foreground\">{u.target}</span>\n                  {u.to && (\n                    <>\n                      {\" \"}\n                      to <span className=\"text-foreground\">{u.to}</span>\n                    </>\n                  )}\n                </p>\n                <span className=\"text-muted-foreground text-xs tabular-nums leading-5\">{u.time} ago</span>\n              </li>\n            ))}\n          </ul>\n        </section>\n      </div>\n\n      <aside aria-label=\"Project properties\" className=\"hidden w-64 shrink-0 flex-col gap-4 @4xl:flex\">\n        <div className=\"flex items-center gap-2 font-medium text-muted-foreground text-xs\">\n          <ProgressRing tone={project.tone} value={d.progress} />\n          <span className=\"tabular-nums\">{d.progress}% complete</span>\n        </div>\n        <Properties d={d} project={project} />\n        <div className=\"border-t pt-4 text-muted-foreground text-xs leading-5\">\n          <div className=\"font-medium text-foreground\">Next up</div>\n          {d.targetNote} on <span className=\"text-foreground tabular-nums\">{d.target}</span>.\n        </div>\n      </aside>\n    </div>\n  );\n}\n\nconst inbox = [\n  { who: \"Kai Tanaka\", what: \"assigned you\", target: \"Sidebar density pass\", where: \"Atlas redesign\", time: \"12m\", unread: true },\n  { who: \"Rosa Lind\", what: \"mentioned you on\", target: \"Breadcrumb overflow\", where: \"Atlas redesign\", time: \"48m\", unread: true },\n  { who: \"Theo Brandt\", what: \"asked for review on\", target: \"Tax rounding for EU\", where: \"Billing v2\", time: \"1h\", unread: true },\n  { who: \"Ines Moreau\", what: \"replied on\", target: \"Swipe to archive\", where: \"Mobile beta\", time: \"3h\", unread: true },\n  { who: \"Kai Tanaka\", what: \"closed\", target: \"Failover for eu-west\", where: \"Infra hardening\", time: \"Yesterday\", unread: false },\n];\n\nconst myIssues = [\n  { id: \"ATL-212\", title: \"Collapse sidebar to an icon rail\", project: \"atlas\", state: \"In progress\" },\n  { id: \"ATL-219\", title: \"Keyboard map for navigation\", project: \"atlas\", state: \"Todo\" },\n  { id: \"BIL-142\", title: \"Prorate seat changes mid-cycle\", project: \"billing\", state: \"In progress\" },\n  { id: \"MOB-88\", title: \"Push for mentions only\", project: \"mobile\", state: \"Todo\" },\n  { id: \"GRO-31\", title: \"Guided first project checklist\", project: \"growth\", state: \"In review\" },\n  { id: \"INF-57\", title: \"Alert on p95 latency, not p50\", project: \"infra\", state: \"Todo\" },\n];\n\nconst docs = [\n  { title: \"Navigation principles\", project: \"atlas\", edited: \"Edited 2h ago by Rosa Lind\" },\n  { title: \"Pricing FAQ for support\", project: \"billing\", edited: \"Edited yesterday by Theo Brandt\" },\n  { title: \"Mobile beta test plan\", project: \"mobile\", edited: \"Edited Mon by Kai Tanaka\" },\n  { title: \"On-call handbook\", project: \"infra\", edited: \"Edited Oct 12 by Ines Moreau\" },\n];\n\nfunction NavPage({ id, label, icon: Icon, projects, onOpenProject }: { id: string; label: string; icon: LucideIcon; projects: ShellProject[]; onOpenProject: (p: ShellProject) => void }) {\n  const projectBy = (pid: string) => projects.find((p) => p.id === pid);\n  const rowCls = \"flex w-full cursor-pointer items-center gap-3 rounded-xl px-3 py-2.5 text-left outline-none transition-[background-color,scale] duration-150 ease-out hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.99]\";\n  const intro: Record<string, string> = {\n    home: \"Your projects at a glance.\",\n    inbox: \"Mentions, assignments and reviews waiting on you.\",\n    issues: \"Everything assigned to you, across projects.\",\n    projects: \"Every project in this workspace.\",\n    docs: \"Recently edited docs you can open.\",\n    reports: \"Charts and weekly digests for this workspace.\",\n  };\n  let body: ReactNode;\n  if (id === \"home\" || id === \"projects\") {\n    body = (\n      <ul className=\"grid grid-cols-1 gap-3 @lg:grid-cols-2\">\n        {projects.map((p) => {\n          const d = details[p.id];\n          return (\n            <li key={p.id}>\n              <button\n                className=\"flex w-full cursor-pointer flex-col gap-3 rounded-2xl border bg-card p-4 text-left outline-none transition-[border-color,scale] duration-150 ease-out hover:border-foreground/16 focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.98]\"\n                onClick={() => onOpenProject(p)}\n                type=\"button\"\n              >\n                <span className=\"flex items-center gap-2\">\n                  <span className={cn(\"size-2 rounded-full\", dot[p.tone])} />\n                  <span className=\"font-medium\">{p.name}</span>\n                  {d && <Badge className=\"ms-auto\" variant={statusBadge[d.status].variant}>{statusBadge[d.status].label}</Badge>}\n                </span>\n                {d && (\n                  <>\n                    <span className=\"h-1 overflow-hidden rounded-full bg-muted\">\n                      <span className={cn(\"block h-full origin-left rounded-full\", dot[p.tone])} style={{ transform: `scaleX(${d.progress / 100})` }} />\n                    </span>\n                    <span className=\"flex justify-between text-muted-foreground text-xs tabular-nums\">\n                      <span>{d.progress}% · {p.open ?? d.open} open</span>\n                      <span>Due {d.target}</span>\n                    </span>\n                  </>\n                )}\n              </button>\n            </li>\n          );\n        })}\n      </ul>\n    );\n  } else if (id === \"inbox\") {\n    body = (\n      <ul className=\"-mx-3 flex flex-col\">\n        {inbox.map((n) => (\n          <li key={n.target}>\n            <button className={rowCls} type=\"button\">\n              <Avatar className=\"size-7\">\n                <AvatarFallback className={cn(\"text-[10px]\", people[n.who]?.tone)}>{people[n.who]?.initials}</AvatarFallback>\n              </Avatar>\n              <span className=\"min-w-0 flex-1\">\n                <span className=\"block truncate text-muted-foreground\">\n                  <span className=\"font-medium text-foreground\">{n.who}</span> {n.what} <span className=\"text-foreground\">{n.target}</span>\n                </span>\n                <span className=\"block truncate text-muted-foreground text-xs\">{n.where}</span>\n              </span>\n              <span className=\"text-muted-foreground text-xs tabular-nums\">{n.time}</span>\n              <span className={cn(\"size-1.5 shrink-0 rounded-full\", n.unread ? \"bg-info\" : \"bg-transparent\")} />\n            </button>\n          </li>\n        ))}\n      </ul>\n    );\n  } else if (id === \"issues\") {\n    body = (\n      <ul className=\"-mx-3 flex flex-col\">\n        {myIssues.map((i) => {\n          const p = projectBy(i.project);\n          return (\n            <li key={i.id}>\n              <button className={rowCls} type=\"button\">\n                <span className=\"w-16 shrink-0 font-mono text-muted-foreground text-xs\">{i.id}</span>\n                <span className=\"min-w-0 flex-1 truncate\">{i.title}</span>\n                {p && (\n                  <span className=\"hidden items-center gap-1.5 text-muted-foreground text-xs @md:flex\">\n                    <span className={cn(\"size-1.5 rounded-full\", dot[p.tone])} />\n                    {p.name}\n                  </span>\n                )}\n                <span className=\"w-20 text-right text-muted-foreground text-xs\">{i.state}</span>\n              </button>\n            </li>\n          );\n        })}\n      </ul>\n    );\n  } else if (id === \"docs\") {\n    body = (\n      <ul className=\"-mx-3 flex flex-col\">\n        {docs.map((doc) => {\n          const p = projectBy(doc.project);\n          return (\n            <li key={doc.title}>\n              <button className={rowCls} type=\"button\">\n                <span className=\"flex size-8 shrink-0 items-center justify-center rounded-lg border bg-card text-muted-foreground\">\n                  <FileTextIcon className=\"size-4\" />\n                </span>\n                <span className=\"min-w-0 flex-1\">\n                  <span className=\"block truncate font-medium\">{doc.title}</span>\n                  <span className=\"block truncate text-muted-foreground text-xs\">{doc.edited}</span>\n                </span>\n                {p && (\n                  <span className=\"hidden items-center gap-1.5 text-muted-foreground text-xs @md:flex\">\n                    <span className={cn(\"size-1.5 rounded-full\", dot[p.tone])} />\n                    {p.name}\n                  </span>\n                )}\n              </button>\n            </li>\n          );\n        })}\n      </ul>\n    );\n  } else {\n    body = (\n      <div className=\"flex flex-col items-center rounded-2xl border border-dashed px-6 py-14 text-center\">\n        <span className=\"flex size-10 items-center justify-center rounded-xl border bg-card text-muted-foreground shadow-xs/5\">\n          <Icon className=\"size-5\" />\n        </span>\n        <h2 className=\"mt-4 font-medium\">No {label.toLowerCase()} yet</h2>\n        <p className=\"mt-1 max-w-xs text-pretty text-muted-foreground text-xs\">\n          Start one from a project to track progress over time. It will show up here for the whole workspace.\n        </p>\n        <Button className=\"mt-4\" size=\"sm\" variant=\"outline\">\n          <PlusIcon />\n          New report\n        </Button>\n      </div>\n    );\n  }\n  return (\n    <div className=\"mx-auto flex w-full max-w-4xl flex-col gap-5 px-4 py-6 @3xl:px-8 @3xl:py-8\">\n      <div>\n        <h1 className=\"text-balance font-heading font-semibold text-xl tracking-tight\">{label}</h1>\n        <p className=\"mt-1 text-muted-foreground\">{intro[id] ?? \"\"}</p>\n      </div>\n      {body}\n    </div>\n  );\n}\n\nexport function InsetShell({\n  workspaces = defaultWorkspaces,\n  nav = defaultNav,\n  projects = defaultProjects,\n  user = defaultUser,\n  breadcrumbs,\n  defaultCollapsed = false,\n  children,\n  className,\n}: InsetShellProps) {\n  const [collapsed, setCollapsed] = useState(defaultCollapsed);\n  const [drawer, setDrawer] = useState(false);\n  const [workspace, setWorkspace] = useState(workspaces[0]?.id ?? \"\");\n  const [active, setActive] = useState(`project-${projects[0]?.id ?? \"\"}`);\n  const [pageTitle, setPageTitle] = useState(projects[0]?.name ?? \"Home\");\n  const drawerRef = useRef<HTMLDivElement>(null);\n  const ws = workspaces.find((w) => w.id === workspace) ?? workspaces[0];\n\n  useEffect(() => {\n    if (drawer) drawerRef.current?.focus();\n  }, [drawer]);\n\n  const trail = breadcrumbs ?? [ws?.name ?? \"Orbit\", active.startsWith(\"project-\") ? \"Projects\" : null, pageTitle].filter(\n    (x): x is string => Boolean(x),\n  );\n\n  const navigate = (id: string, label: string) => {\n    setActive(id);\n    setPageTitle(label);\n    setDrawer(false);\n  };\n\n  const currentProject = projects.find((p) => `project-${p.id}` === active);\n  const currentNav = nav.find((n) => n.id === active);\n  const page = currentProject ? (\n    <ProjectOverview project={currentProject} />\n  ) : currentNav ? (\n    <NavPage\n      icon={currentNav.icon}\n      id={currentNav.id}\n      label={currentNav.label}\n      onOpenProject={(p) => navigate(`project-${p.id}`, p.name)}\n      projects={projects}\n    />\n  ) : null;\n\n  const sidebarProps = {\n    workspaces,\n    workspace,\n    onWorkspace: setWorkspace,\n    nav,\n    active,\n    onNavigate: navigate,\n    projects,\n    user,\n  };\n\n  return (\n    <MotionConfig reducedMotion=\"user\">\n      <TooltipProvider delay={400}>\n      <div\n        className={cn(\n          \"@container relative isolate flex h-[760px] w-full overflow-hidden bg-sidebar text-foreground text-sm\",\n          className,\n        )}\n        onKeyDown={(e) => {\n          if (e.key === \"Escape\" && drawer) setDrawer(false);\n        }}\n      >\n        <motion.aside\n          animate={{ width: collapsed ? 56 : 248 }}\n          aria-label=\"Sidebar\"\n          className=\"hidden shrink-0 overflow-hidden @3xl:block\"\n          initial={false}\n          transition={widthSpring}\n        >\n          <div className=\"h-full w-full\">\n            <SidebarBody {...sidebarProps} collapsed={collapsed} />\n          </div>\n        </motion.aside>\n\n        <AnimatePresence>\n          {drawer && (\n            <>\n              <motion.div\n                animate={{ opacity: 1 }}\n                aria-hidden\n                className=\"absolute inset-0 z-40 bg-black/32 backdrop-blur-[1px] @3xl:hidden\"\n                exit={{ opacity: 0 }}\n                initial={{ opacity: 0 }}\n                onClick={() => setDrawer(false)}\n              />\n              <motion.div\n                animate={{ x: 0 }}\n                aria-label=\"Navigation\"\n                aria-modal=\"true\"\n                className=\"absolute inset-y-2 left-2 z-50 w-[272px] max-w-[calc(100%-3rem)] overflow-hidden rounded-2xl border bg-sidebar shadow-lg/10 outline-none @3xl:hidden\"\n                exit={{ x: \"-110%\" }}\n                initial={{ x: \"-110%\" }}\n                ref={drawerRef}\n                role=\"dialog\"\n                tabIndex={-1}\n                transition={spring}\n              >\n                <SidebarBody {...sidebarProps} collapsed={false} onClose={() => setDrawer(false)} />\n              </motion.div>\n            </>\n          )}\n        </AnimatePresence>\n\n        <div className=\"flex min-w-0 flex-1 flex-col @3xl:py-2 @3xl:pe-2\">\n          <main className=\"flex min-h-0 flex-1 flex-col overflow-hidden bg-background @3xl:rounded-2xl @3xl:border @3xl:shadow-xs/5\">\n            <header className=\"flex h-13 shrink-0 items-center gap-2 border-b px-3 @3xl:px-4\">\n              <Button\n                aria-label=\"Open navigation\"\n                className=\"@3xl:hidden\"\n                onClick={() => setDrawer(true)}\n                size=\"icon-sm\"\n                variant=\"ghost\"\n              >\n                <MenuIcon />\n              </Button>\n              <Tooltip>\n                <TooltipTrigger\n                  render={\n                    <Button\n                      aria-expanded={!collapsed}\n                      aria-label={collapsed ? \"Expand sidebar\" : \"Collapse sidebar\"}\n                      className=\"hidden @3xl:inline-flex\"\n                      onClick={() => setCollapsed((c) => !c)}\n                      size=\"icon-sm\"\n                      variant=\"ghost\"\n                    />\n                  }\n                >\n                  <PanelLeftIcon />\n                </TooltipTrigger>\n                <TooltipPopup>{collapsed ? \"Expand sidebar\" : \"Collapse sidebar\"}</TooltipPopup>\n              </Tooltip>\n              <span className=\"h-4 w-px bg-border\" />\n              <Breadcrumb className=\"min-w-0 flex-1\">\n                <BreadcrumbList className=\"flex-nowrap gap-1.5 sm:gap-1.5\">\n                  {trail.map((crumb, i) => {\n                    const last = i === trail.length - 1;\n                    return (\n                      <motion.li className={cn(\"flex min-w-0 items-center gap-1.5\", !last && \"hidden @md:flex\")} key={`${i}-${crumb}`} layout=\"position\">\n                        {last ? (\n                          <AnimatePresence initial={false} mode=\"popLayout\">\n                            <motion.span\n                              animate={{ opacity: 1, y: 0 }}\n                              exit={{ opacity: 0, y: -6 }}\n                              initial={{ opacity: 0, y: 6 }}\n                              key={crumb}\n                              transition={spring}\n                            >\n                              <BreadcrumbPage className=\"truncate font-medium\">{crumb}</BreadcrumbPage>\n                            </motion.span>\n                          </AnimatePresence>\n                        ) : (\n                          <>\n                            <BreadcrumbLink className=\"truncate\" href=\"#\" onClick={(e) => e.preventDefault()}>\n                              {crumb}\n                            </BreadcrumbLink>\n                            <ChevronRightIcon aria-hidden className=\"size-3.5 shrink-0 text-muted-foreground/60\" />\n                          </>\n                        )}\n                      </motion.li>\n                    );\n                  })}\n                </BreadcrumbList>\n              </Breadcrumb>\n              <div className=\"flex items-center gap-1.5\">\n                <div className=\"me-1 hidden -space-x-1 @lg:flex\">\n                  {[\n                    [\"KT\", \"bg-info/16 text-info-foreground\"],\n                    [\"RL\", \"bg-orange-500/16 text-orange-800 dark:text-orange-400\"],\n                    [\"TB\", \"bg-violet-500/20 text-violet-700 dark:text-violet-400\"],\n                  ].map(([i, t]) => (\n                    <Avatar className=\"size-6 bg-background ring-2 ring-background\" key={i}>\n                      <AvatarFallback className={cn(\"text-[10px]\", t)}>{i}</AvatarFallback>\n                    </Avatar>\n                  ))}\n                </div>\n                <Button className=\"hidden @md:inline-flex\" size=\"sm\" variant=\"outline\">\n                  <Share2Icon />\n                  Share\n                </Button>\n                <Button aria-label=\"Notifications\" className=\"relative\" size=\"icon-sm\" variant=\"ghost\">\n                  <BellIcon />\n                  <span className=\"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-info\" />\n                </Button>\n              </div>\n            </header>\n            <div className=\"min-h-0 flex-1 overflow-y-auto\" key={children ? undefined : active}>\n              {children ?? (\n                <motion.div animate={{ opacity: 1 }} initial={{ opacity: 0 }} transition={{ duration: 0.15, ease: \"easeOut\" }}>\n                  {page}\n                </motion.div>\n              )}\n            </div>\n          </main>\n        </div>\n      </div>\n      </TooltipProvider>\n    </MotionConfig>\n  );\n}\n"
    }
  ]
}