quivr/frontend/app/chat/layout.tsx
Zineb El Bachiri f4aa22417f
Refactor/front (#313)
* 🚚 move footer component

* 🚚 move navbar component

* 🚚 move ui components

* 🚚 move browser tab icon to public folder

* 🚚 move Chat Provider

* 🚚 move hooks to lib

* 🚚  move helpers to lib

* 🚚 move types to lib
2023-06-13 16:33:41 +02:00

27 lines
647 B
TypeScript

"use client";
import { ChatsProvider } from "@/lib/context/ChatsProvider/chats-provider";
import { redirect } from "next/navigation";
import { FC, ReactNode } from "react";
import { useSupabase } from "../supabase-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;