import type { FunctionComponent } from 'react';
import { Navigate, Outlet } from 'react-router-dom';
import { FullScreenLoader } from '@/common/components/molecules/FullScreenLoader/FullScreenLoader';
import { SidebarInset, SidebarProvider } from '@/common/components/organisms/Sidebar/Sidebar';
import { AppSidebar } from './components/AppSidebar';
import { useAuthenticatedLayoutLogic } from './hooks/useAuthenticatedLayoutLogic/useAuthenticatedLayoutLogic';
export const AuthenticatedLayout: FunctionComponent = () => {
const { shouldRedirect, isLoading, redirectUnauthenticatedTo, location } =
useAuthenticatedLayoutLogic();
if (isLoading || !redirectUnauthenticatedTo) {
return ;
}
if (shouldRedirect) {
return (
);
}
return (
);
};