mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-21 02:11:35 +03:00
e885574d1e
Issue: https://github.com/StanGirard/quivr/issues/1889 Demo: https://github.com/StanGirard/quivr/assets/63923024/f9853b7e-e358-4c98-9281-4b0752a29632
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;
|