import { Grid, Container } from "@mui/material";
import CookieConsent from "react-cookie-consent";
import { useCookies } from "react-cookie";
import { TopNav } from "./TopNav";
import { Sidebar } from "./Sidebar";
import { GettingStartedDialog } from "./GettingStartedDialog";
import { useAppContext } from "./AppProvider";
// import { Footer } from "./Footer";
export const Layout = ({ children }) => {
const [cookies, setCookie] = useCookies(["cookieConsent"]);
const consentGranted = cookies.cookieConsent === "true";
const {
colors: {
white,
almostBlack,
leafcutterElectricBlue,
cdrLinkOrange,
helpYellow,
},
} = useAppContext();
return (
<>
{children}
{/* */}
{!consentGranted ? (
setCookie("cookieConsent", "true", { path: "/" })}
buttonStyle={{
borderRadius: 500,
backgroundColor: cdrLinkOrange,
color: white,
textTransform: "uppercase",
padding: "10px 20px",
fontWeight: "bold",
fontSize: 14,
}}
>
Leafcutter uses cookies for core funtionality.
) : null}
>
);
};