import { auth } from "@clerk/nextjs/server"; import Header from "@/components/layout/Header"; import Footer from "@/components/layout/Footer"; import AppShell from "@/app/(app)/AppShell"; import { PageKey } from "@/app/(app)/AppShell"; interface DynamicPageLayoutProps { children: React.ReactNode; pageKey: PageKey; } export default async function DynamicPageLayout({ children, pageKey, }: DynamicPageLayoutProps) { const { userId } = await auth(); if (userId) { // Authenticated: Show the AppShell (Sidebar) return ( ); } // Not Authenticated: Show Landing Page Layout (Header/Footer) return (
{children}
); }