mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-24 07:36:39 +03:00
7480e89fa9
Issue: https://github.com/StanGirard/quivr/issues/1902 Demo: https://github.com/StanGirard/quivr/assets/63923024/33170c91-3bdc-442a-918a-5013b423f8e5
25 lines
547 B
TypeScript
25 lines
547 B
TypeScript
"use client";
|
|
import { ReactNode } from "react";
|
|
|
|
import { useSupabase } from "@/lib/context/SupabaseProvider";
|
|
import { redirectToLogin } from "@/lib/router/redirectToLogin";
|
|
|
|
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 overflow-scroll">
|
|
{children}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Layout;
|