mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-21 02:11:35 +03:00
9c8e0aa0e4
* 🗑️ remove date input from fetch_user_id_from_credentials * ♻️ refactor backend utils by splitting it into files * 💡 comments for next actions to update /upload * 🚚 move SupabaseProvider tp libs * 🚚 move useAxios to hooks * ♻️ refacto brain routes * 🚨 update lintermfor paths * ✨ new brain context provider * ✨ new brain component in navbar * 🚨 fix linter and async * 🇸🇪 add feature flag for multiple-brains
31 lines
682 B
TypeScript
31 lines
682 B
TypeScript
"use client";
|
|
import { redirect } from "next/navigation";
|
|
import { ReactNode } from "react";
|
|
|
|
import { ChatsProvider } from "@/lib/context/ChatsProvider/chats-provider";
|
|
import { useSupabase } from "@/lib/context/SupabaseProvider";
|
|
|
|
import { ChatsList } from "./components";
|
|
|
|
interface LayoutProps {
|
|
children?: ReactNode;
|
|
}
|
|
|
|
const Layout = ({ children }: LayoutProps): JSX.Element => {
|
|
const { session } = useSupabase();
|
|
if (session === null) {
|
|
redirect("/login");
|
|
}
|
|
|
|
return (
|
|
<ChatsProvider>
|
|
<div className="relative h-full w-full flex items-start">
|
|
<ChatsList />
|
|
{children}
|
|
</div>
|
|
</ChatsProvider>
|
|
);
|
|
};
|
|
|
|
export default Layout;
|