mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 17:43:03 +03:00
52e723d534
* fix(chat): Use a global chat context to avoid duplicate states * fix(chat): update chats list when creating a new chat
27 lines
635 B
TypeScript
27 lines
635 B
TypeScript
"use client";
|
|
import { redirect } from "next/navigation";
|
|
import { FC, ReactNode } from "react";
|
|
import { useSupabase } from "../supabase-provider";
|
|
import { ChatsProvider } from "./ChatsProvider/chats-provider";
|
|
import { ChatsList } from "./components";
|
|
|
|
interface LayoutProps {
|
|
children?: ReactNode;
|
|
}
|
|
|
|
const Layout: FC<LayoutProps> = ({ children }) => {
|
|
const { session } = useSupabase();
|
|
if (!session) redirect("/login");
|
|
|
|
return (
|
|
<ChatsProvider>
|
|
<div className="relative h-full w-full flex items-start">
|
|
<ChatsList />
|
|
{children}
|
|
</div>
|
|
</ChatsProvider>
|
|
);
|
|
};
|
|
|
|
export default Layout;
|