SPB Git
715 B · 9 lines tsx
1import { requireUserPage, getWorkspace } from "@/lib/auth/guard";2import { listTree } from "@/lib/pages/service";3import { Shell } from "@/components/shell/Shell";4export default async function AppLayout({ children }: { children: React.ReactNode }) {5  const user = await requireUserPage(); const ws = await getWorkspace(user.id);6  const tree = await listTree(ws.id);7  return <Shell user={{ id: user.id, username: user.username, displayName: user.displayName }} workspace={{ id: ws.id, name: ws.name }} initialTree={tree.map((p) => ({ id: p.id, parentId: p.parentId, title: p.title, icon: p.icon, type: p.type, section: p.section, pinned: p.pinned, updatedAt: p.updatedAt.toISOString() }))}>{children}</Shell>;8}9
Files · 2c37cb5a3e2af18e5ba361996d453cab97da82c2
Menu

Theme