28 lines
697 B
TypeScript
28 lines
697 B
TypeScript
"use client";
|
|
|
|
import { usePathname } from "next/navigation";
|
|
import Header from "@/components/Header";
|
|
import Footer from "@/components/Footer";
|
|
|
|
export default function LayoutClient({ children }: { children: React.ReactNode }) {
|
|
const pathname = usePathname();
|
|
|
|
// Ne pas afficher Header/Footer dans l'espace admin et employé
|
|
const isAdminRoute = pathname?.startsWith("/admin");
|
|
const isEmployeRoute = pathname?.startsWith("/employe");
|
|
|
|
if (isAdminRoute || isEmployeRoute) {
|
|
return <>{children}</>;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<Header />
|
|
<main className="flex-1 container mx-auto px-4 py-6 sm:px-6 lg:px-8">
|
|
{children}
|
|
</main>
|
|
<Footer />
|
|
</>
|
|
);
|
|
}
|