ldc-qualimaine/resources/ts/front/Layouts/AppLayout.tsx
Abdel LAMRANI 7baa1c18e4 fix: 🐛 eslint
2026-08-07 13:40:17 +02:00

67 lines
2 KiB
TypeScript

import { usePage } from "@inertiajs/react";
import { type ReactNode } from "react";
import useDeviceType from "@/hooks/use-device-type";
import {
animations,
positionBannerButton,
} from "../Components/cookie/constants";
import CookieNotice from "../Components/cookie/CookieNotice";
import { RecaptchaProvider } from "../Components/cookie/recaptcha/RecaptchaProvider";
import Footer from "../Components/Layout/Footer";
import ScrollToTopButton from "../Components/Layout/ScrollToTopButton";
import SiteNavbar from "../Components/Layout/SiteNavbar";
interface AppLayoutProps {
children: ReactNode;
}
const HOME_COMPONENT = "front/Pages/Home";
export default function AppLayout({ children }: AppLayoutProps) {
const { component } = usePage();
const isHome = component === HOME_COMPONENT;
const { isMobile } = useDeviceType();
return (
<RecaptchaProvider>
<CookieNotice
services={["matomo"] as const}
animationButton={animations.SCALE}
animationBanner={animations.SCALE}
hasLogo
bannerButtonPosition={
isMobile ? positionBannerButton.aside.left : undefined
}
learnMoreHref={route("front.privacy-policy")}
variants={{
btnActionVariant: "default",
closeBtnVariant: "ghost",
bannerBtnVariant: "default",
serviceBg: "bg-secondary border-secondary",
switchBg: "data-[state=checked]:bg-primary",
modalBg: "bg-card",
}}
texts={{
size: "normal",
services: {
// description: "text-red-600",
link: "text-yellow-500",
// title: "text-yellow-500"
},
modal: {
// description: "text-red-600",
link: "text-yellow-500",
// title: "text-yellow-500"
},
}}
/>
{!isHome && <SiteNavbar />}
<main className="bg-band/25">
{children}
<Footer />
</main>
<ScrollToTopButton />
</RecaptchaProvider>
);
}