All files / components/layout AuthenticatedLayout.tsx

100% Statements 6/6
100% Branches 0/0
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40      12x 12x 12x                       12x           19x 19x                              
'use client';
 
import { ReactNode } from 'react';
import AuthGuard from '@/components/connexion/authGuard';
import AppHeader from '@/components/navigation/AppHeader';
import { useSessionExpiry } from '@/hooks/useSessionExpiry';
 
/**
 * Props pour le composant AuthenticatedLayout
 */
interface Props {
  children: ReactNode;
  title: string;
  backUrl?: string;
  backLabel?: string;
}
 
export default function AuthenticatedLayout({ 
    children, 
    title, 
    backUrl, 
    backLabel 
}: Props) {
    useSessionExpiry();
    return (
        <AuthGuard>
            <div className="bg-base-200">
                <AppHeader 
                    title={title}
                    backUrl={backUrl}
                    backLabel={backLabel}
                />
                <main className="">
                {children}
                </main>
            </div>
        </AuthGuard>
    );
}