This repository has no description
564 B
21 lines
1'use client';
2
3import AppLayout from '../appLayout/AppLayout';
4import GuestAppLayout from '../guestAppLayout/GuestAppLayout';
5import DashboardSkeleton from './Skeleton.Dashboard';
6import { useAuth } from '@/hooks/useAuth';
7
8interface Props {
9 children: React.ReactNode;
10}
11
12export default function Dashboard(props: Props) {
13 const { isAuthenticated, isLoading } = useAuth();
14
15 if (isLoading) return <DashboardSkeleton />;
16
17 if (!isAuthenticated)
18 return <GuestAppLayout>{props.children}</GuestAppLayout>;
19
20 return <AppLayout>{props.children}</AppLayout>;
21}