mirror of
https://github.com/handsomezhuzhu/QQuiz.git
synced 2026-04-18 22:42:53 +00:00
完善文档与前端迁移,补充开源协议
This commit is contained in:
29
web/src/app/(app)/layout.tsx
Normal file
29
web/src/app/(app)/layout.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { AppSidebar } from "@/components/app-shell/app-sidebar";
|
||||
import { LogoutButton } from "@/components/app-shell/logout-button";
|
||||
import { requireCurrentUser } from "@/lib/auth/guards";
|
||||
|
||||
export default async function AppLayout({
|
||||
children
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const currentUser = await requireCurrentUser();
|
||||
|
||||
return (
|
||||
<div className="min-h-screen xl:flex">
|
||||
<AppSidebar isAdmin={currentUser.is_admin} />
|
||||
<div className="min-h-screen flex-1">
|
||||
<div className="flex items-center justify-between border-b border-slate-200/80 bg-white/70 px-6 py-4 backdrop-blur">
|
||||
<div>
|
||||
<p className="text-xs uppercase tracking-[0.2em] text-slate-500">QQuiz</p>
|
||||
<p className="text-sm text-slate-600">
|
||||
{currentUser.username} · {currentUser.is_admin ? "管理员" : "普通用户"}
|
||||
</p>
|
||||
</div>
|
||||
<LogoutButton />
|
||||
</div>
|
||||
<main className="container py-8">{children}</main>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user