This commit is contained in:
Akshay 2026-04-20 23:49:04 +00:00 committed by GitHub
commit 973d13f35b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,10 +1,13 @@
import Link from "next/link"
import { getServerSession } from "next-auth/next"
import { marketingConfig } from "@/config/marketing"
import { authOptions } from "@/lib/auth"
import { cn } from "@/lib/utils"
import { buttonVariants } from "@/components/ui/button"
import { MainNav } from "@/components/main-nav"
import { SiteFooter } from "@/components/site-footer"
import { UserAccountNav } from "@/components/user-account-nav"
interface MarketingLayoutProps {
children: React.ReactNode
@ -13,21 +16,33 @@ interface MarketingLayoutProps {
export default async function MarketingLayout({
children,
}: MarketingLayoutProps) {
const session = await getServerSession(authOptions)
return (
<div className="flex min-h-screen flex-col">
<header className="container z-40 bg-background">
<div className="flex h-20 items-center justify-between py-6">
<MainNav items={marketingConfig.mainNav} />
<nav>
<Link
href="/login"
className={cn(
buttonVariants({ variant: "secondary", size: "sm" }),
"px-4"
)}
>
Login
</Link>
{session?.user ? (
<UserAccountNav
user={{
name: session.user.name,
image: session.user.image,
email: session.user.email
}}
/>
) : (
<Link
href="/login"
className={cn(
buttonVariants({ variant: "secondary", size: "sm" }),
"px-4"
)}
>
Login
</Link>
)}
</nav>
</div>
</header>