quivr/frontend/app/chat/layout.tsx
Aditya Nandan 315411facd
remove blank scrollbars and use predefined components (#452)
* style(chat and brains dropdown): remove blank scrollbars and use predefined components

* style(chat): use custom scrollbar style by using scrollbar class
2023-07-02 14:30:11 +02:00

31 lines
700 B
TypeScript

"use client";
import { redirect } from "next/navigation";
import { ReactNode } from "react";
import { ChatsProvider } from "@/lib/context/ChatsProvider/chats-provider";
import { useSupabase } from "@/lib/context/SupabaseProvider";
import { ChatsList } from "./components";
interface LayoutProps {
children?: ReactNode;
}
const Layout = ({ children }: LayoutProps): JSX.Element => {
const { session } = useSupabase();
if (session === null) {
redirect("/login");
}
return (
<ChatsProvider>
<div className="relative h-full w-full flex justify-stretch items-stretch">
<ChatsList />
{children}
</div>
</ChatsProvider>
);
};
export default Layout;