mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-16 10:02:30 +03:00
28 lines
606 B
TypeScript
28 lines
606 B
TypeScript
|
"use client";
|
||
|
import { ReactNode } from "react";
|
||
|
|
||
|
import { useSupabase } from "@/lib/context/SupabaseProvider";
|
||
|
import { redirectToLogin } from "@/lib/router/redirectToLogin";
|
||
|
|
||
|
import { BrainsList } from "./[brainId]/components";
|
||
|
|
||
|
interface LayoutProps {
|
||
|
children?: ReactNode;
|
||
|
}
|
||
|
|
||
|
const Layout = ({ children }: LayoutProps): JSX.Element => {
|
||
|
const { session } = useSupabase();
|
||
|
if (session === null) {
|
||
|
redirectToLogin();
|
||
|
}
|
||
|
|
||
|
return (
|
||
|
<div className="relative h-full w-full flex justify-stretch items-stretch">
|
||
|
<BrainsList />
|
||
|
{children}
|
||
|
</div>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default Layout;
|