feat: add Discord profile dropdown menu with role display and integrate with admin and form layouts via AdminShellServer.

This commit is contained in:
2026-07-03 23:02:15 +07:00 Unverified
parent 6cb28421e6
commit ac6c35598c
12 changed files with 413 additions and 83 deletions
+24
View File
@@ -0,0 +1,24 @@
import { getServerSession } from "next-auth";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { getDiscordMemberProfile } from "@/app/actions/discord";
import { AdminShell } from "@/components/admin-shell";
export async function AdminShellServer({ children }: { children: React.ReactNode }) {
const session = await getServerSession(authOptions);
const discordId = (session?.user as any)?.discordId;
let profile = null;
if (discordId) {
profile = await getDiscordMemberProfile(discordId);
}
return (
<AdminShell
userName={session?.user?.name ?? ""}
userImage={session?.user?.image ?? ""}
profile={profile}
>
{children}
</AdminShell>
);
}