mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 17:43:03 +03:00
80be40ad34
* feat: remove react-mentions * feat: add chat header * feat: remove v2/chat * feat: add fature flag * feat: add new chat UI * feat: add prompt and brain name to messages
35 lines
827 B
TypeScript
35 lines
827 B
TypeScript
"use client";
|
|
import { ReactNode } from "react";
|
|
|
|
import { ChatProvider } from "@/lib/context";
|
|
import { ChatsProvider } from "@/lib/context/ChatsProvider/chats-provider";
|
|
import { useSupabase } from "@/lib/context/SupabaseProvider";
|
|
import { redirectToLogin } from "@/lib/router/redirectToLogin";
|
|
|
|
import { ChatsList } from "./components/ChatsList";
|
|
|
|
interface LayoutProps {
|
|
children?: ReactNode;
|
|
}
|
|
|
|
const Layout = ({ children }: LayoutProps): JSX.Element => {
|
|
const { session } = useSupabase();
|
|
|
|
if (session === null) {
|
|
redirectToLogin();
|
|
}
|
|
|
|
return (
|
|
<ChatsProvider>
|
|
<ChatProvider>
|
|
<div className="relative h-full w-full flex justify-stretch items-stretch">
|
|
<ChatsList />
|
|
{children}
|
|
</div>
|
|
</ChatProvider>
|
|
</ChatsProvider>
|
|
);
|
|
};
|
|
|
|
export default Layout;
|