mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-18 20:01:52 +03:00
f13f08c5c5
https://github.com/StanGirard/quivr/issues/1331 https://github.com/StanGirard/quivr/assets/63923024/eef62e2a-3c7c-4b08-b69c-2ba4d3b4b1be
37 lines
929 B
TypeScript
37 lines
929 B
TypeScript
"use client";
|
|
import { ReactNode } from "react";
|
|
|
|
import { ChatProvider, KnowledgeToFeedProvider } 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 (
|
|
<KnowledgeToFeedProvider>
|
|
<ChatsProvider>
|
|
<ChatProvider>
|
|
<div className="relative h-full w-full flex justify-stretch items-stretch">
|
|
<ChatsList />
|
|
{children}
|
|
</div>
|
|
</ChatProvider>
|
|
</ChatsProvider>
|
|
</KnowledgeToFeedProvider>
|
|
);
|
|
};
|
|
|
|
export default Layout;
|