mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 17:43:03 +03:00
a46bf52478
Issue: https://github.com/StanGirard/quivr/issues/1578 Demo <img width="1512" alt="Screenshot 2023-11-06 at 14 26 14" src="https://github.com/StanGirard/quivr/assets/63923024/ef583683-43da-4b42-927e-22431cbeb0cf">
38 lines
986 B
TypeScript
38 lines
986 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, NotificationBanner } from "./components";
|
|
|
|
interface LayoutProps {
|
|
children?: ReactNode;
|
|
}
|
|
|
|
const Layout = ({ children }: LayoutProps): JSX.Element => {
|
|
const { session } = useSupabase();
|
|
|
|
if (session === null) {
|
|
redirectToLogin();
|
|
}
|
|
|
|
return (
|
|
<KnowledgeToFeedProvider>
|
|
<ChatsProvider>
|
|
<ChatProvider>
|
|
<NotificationBanner />
|
|
<div className="relative h-full w-full flex justify-stretch items-stretch overflow-auto">
|
|
<ChatsList />
|
|
{children}
|
|
</div>
|
|
</ChatProvider>
|
|
</ChatsProvider>
|
|
</KnowledgeToFeedProvider>
|
|
);
|
|
};
|
|
|
|
export default Layout;
|