Spaces:
Sleeping
Sleeping
import { Suspense } from 'react'; | |
import Loading from '@/components/ui/Loading'; | |
import { sessionUser } from '@/auth'; | |
import { redirect } from 'next/navigation'; | |
import ChatSidebarList from '@/components/chat-sidebar/ChatListSidebar'; | |
interface ChatLayoutProps { | |
children: React.ReactNode; | |
} | |
export default async function Layout({ children }: ChatLayoutProps) { | |
return <div>TO BE FIXED</div>; | |
// const { isAdmin, user } = await sessionUser(); | |
// if (!isAdmin) { | |
// redirect('/'); | |
// } | |
// const chats = await adminGetAllKVChats(); | |
// return ( | |
// <div className="relative flex h-[calc(100vh_-_theme(spacing.16))] overflow-hidden"> | |
// {user && ( | |
// <div | |
// data-state="open" | |
// className="peer absolute inset-y-0 z-30 hidden border-r bg-muted duration-300 ease-in-out translate-x-0 lg:flex lg:w-[250px] xl:w-[300px] h-full flex-col dark:bg-zinc-950 overflow-auto py-2" | |
// > | |
// <Suspense fallback={<Loading />}> | |
// <ChatSidebarList chats={chats} isAdminView /> | |
// </Suspense> | |
// </div> | |
// )} | |
// <Suspense fallback={<Loading />}> | |
// <div className="group w-full overflow-auto pl-0 animate-in duration-300 ease-in-out peer-[[data-state=open]]:lg:pl-[250px] peer-[[data-state=open]]:xl:pl-[300px]"> | |
// {children} | |
// </div> | |
// </Suspense> | |
// </div> | |
// ); | |
} | |