mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-21 10:21:54 +03:00
26 lines
546 B
TypeScript
26 lines
546 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-auto">
|
||
|
{children}
|
||
|
</div>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default Layout;
|