parent
7faa5f1c9f
commit
a68eb2a011
41 changed files with 2350 additions and 800 deletions
22
app/(chat)/layout.tsx
Normal file
22
app/(chat)/layout.tsx
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { cookies } from 'next/headers';
|
||||
|
||||
import { AppSidebar } from '@/components/custom/app-sidebar';
|
||||
import { SidebarInset, SidebarProvider } from '@/components/ui/sidebar';
|
||||
|
||||
import { auth } from '../(auth)/auth';
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const [session, cookieStore] = await Promise.all([auth(), cookies()]);
|
||||
const isCollapsed = cookieStore.get('sidebar:state')?.value !== 'true';
|
||||
|
||||
return (
|
||||
<SidebarProvider defaultOpen={!isCollapsed}>
|
||||
<AppSidebar user={session?.user} />
|
||||
<SidebarInset>{children}</SidebarInset>
|
||||
</SidebarProvider>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue