Files
erika/app/form/layout.tsx
T

31 lines
937 B
TypeScript

import { getServerSession } from "next-auth";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
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>
{!session && <LoginDialog />}
</div>
);
}