import React, { useEffect, useState } from "react"; import Head from "next/head"; import { useRouter } from "next/router"; import LeftSidebar from "@/components/_App/LeftSidebar"; import TopNavbar from "@/components/_App/TopNavbar"; import Footer from "@/components/_App/Footer"; import ScrollToTop from "./ScrollToTop"; import ControlPanelModal from "./ControlPanelModal"; const Layout = ({ children }) => { const router = useRouter(); const [active, setActive] = useState(false); const [isAuthenticationPage, setIsAuthenticationPage] = useState(false); const toggleActive = () => { setActive(!active); }; useEffect(() => { const authenticationPages = [ "/auth/login", "/auth/sign-up", "/auth/forgot-password", "/auth/lock-screen", "/auth/confirm-mail", ]; setIsAuthenticationPage(authenticationPages.includes(router.pathname)); }, [router.pathname]); // Debugging: Log the value of isAuthenticationPage // console.log("isAuthenticationPage:", isAuthenticationPage, router.pathname); const title = isAuthenticationPage ? "CMC - auth" : "CMC - dashboard"; return ( <>