2023-07-24 15:17:21 +03:00
|
|
|
"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 (
|
2023-12-14 12:15:38 +03:00
|
|
|
<div className="relative h-full w-full flex justify-stretch items-stretch overflow-scroll">
|
2023-09-28 16:39:30 +03:00
|
|
|
{children}
|
2023-07-24 15:17:21 +03:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Layout;
|