mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-18 08:02:03 +03:00
85eba3da70
* feat: add OnboardingContext * feat: add Step3 boilerplate * feat: activate step3 * feat: add <Step3/> content * feat: add shouldStream guard on useStreamText
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
"use client";
|
|
import { ReactNode } from "react";
|
|
|
|
import { ChatProvider, KnowledgeToFeedProvider } from "@/lib/context";
|
|
import { ChatsProvider } from "@/lib/context/ChatsProvider/chats-provider";
|
|
import { OnboardingContextProvider } from "@/lib/context/OnboardingContext/knowledgeToFeed-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>
|
|
<OnboardingContextProvider>
|
|
<div className="relative h-full w-full flex justify-stretch items-stretch">
|
|
<ChatsList />
|
|
{children}
|
|
</div>
|
|
</OnboardingContextProvider>
|
|
</ChatProvider>
|
|
</ChatsProvider>
|
|
</KnowledgeToFeedProvider>
|
|
);
|
|
};
|
|
|
|
export default Layout;
|