mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 17:43:03 +03:00
6acb13d4ae
* refactor(<ChatPage/>) * test(<ChatInput />): add unit tests * test(<ChatMessages />): add unit tests
31 lines
710 B
TypeScript
31 lines
710 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/ChatsList";
|
|
|
|
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;
|