33 lines
1005 B
TypeScript
33 lines
1005 B
TypeScript
import { getServerSession } from "next-auth";
|
|
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
|
|
import { Toaster } from "@/components/ui/sonner";
|
|
import { FormLayoutClient } from "./client";
|
|
import LoginDialog from "@/components/login-dialog";
|
|
|
|
export default async function FormLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const session = await getServerSession(authOptions);
|
|
|
|
return (
|
|
<div className="min-h-screen flex flex-col">
|
|
<header className="border-b border-border px-6 py-3 flex items-center justify-between">
|
|
<span className="font-semibold text-sm text-muted-foreground tracking-wide uppercase">
|
|
Forms
|
|
</span>
|
|
{session?.user && (
|
|
<FormLayoutClient
|
|
userName={session.user.name ?? ""}
|
|
userImage={session.user.image ?? ""}
|
|
/>
|
|
)}
|
|
</header>
|
|
<main className="flex-1">{children}</main>
|
|
<Toaster />
|
|
{!session && <LoginDialog />}
|
|
</div>
|
|
);
|
|
}
|