import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar"; import { AdminSidebar } from "./client"; import { Metadata } from "next"; import { getServerSession } from "next-auth"; import { authOptions } from "@/app/api/auth/[...nextauth]/route"; import { getSessionDiscordId } from "@/lib/auth"; import { getDiscordMemberProfile } from "@/lib/discord"; export const metadata: Metadata = { title: { default: "Admin", template: "%s | Erika!", }, } export default async function AdminFormLayout( props: { children: React.ReactNode; params: Promise<{ id: string }>; } ) { const params = await props.params; const session = await getServerSession(authOptions); let profile = null; const discordId = getSessionDiscordId(session); if (discordId) { profile = await getDiscordMemberProfile(discordId); } return (
{props.children}
); }