import { Box, Divider, Typography, useMediaQuery, useTheme } from "@mui/material";
import NavMenuItem from "./NavMenuItem";
import PenaLogo from "./PenaLogo";
import SectionWrapper from "./SectionWrapper";


export default function Footer() {
    const theme = useTheme();
    const upMd = useMediaQuery(theme.breakpoints.up("md"));

    return (
        <SectionWrapper
            component="footer"
            maxWidth="lg"
            outerContainerSx={{
                backgroundColor: theme.palette.custom.darkPurple.main,
            }}
            sx={{
                pt: upMd ? "100px" : "80px",
                pb: upMd ? "75px" : "24px",
                display: "flex",
                flexDirection: "column",
                alignItems: "center",
                gap: upMd ? "90px" : undefined,
            }}
        >
            <Box
                sx={{
                    display: "flex",
                    flexDirection: upMd ? "row" : "column",
                }}
            >
                <Box
                    sx={{
                        flexBasis: upMd ? "260px" : "98px",
                    }}
                >
                    <PenaLogo width={124} theme="dark" />
                </Box>
                <Box
                    sx={{
                        display: "flex",
                        flexDirection: upMd ? "row" : "column",
                        flexWrap: "wrap",
                        flexGrow: 1,
                        flexShrink: 1,
                        flexBasis: upMd ? "600px" : undefined,
                        mb: upMd ? undefined : "30px",
                        gap: upMd ? undefined : "18px",
                        "& a": {
                            width: upMd ? "33%" : undefined,
                        }
                    }}
                >
                    <NavMenuItem text="Меню 1" />
                    <NavMenuItem text="Меню 1" />
                    <NavMenuItem text="Меню 1" />
                    <NavMenuItem text="Меню 1" />
                    <NavMenuItem text="Меню 1" />
                    <NavMenuItem text="Меню 1" />
                    <NavMenuItem text="Меню 1" />
                    <NavMenuItem text="Меню 1" />
                    <NavMenuItem text="Меню 1" />
                </Box>
                <Typography
                    variant="body2"
                    sx={{
                        flexBasis: upMd ? "300px" : undefined,
                        pr: "5%",
                        mb: upMd ? undefined : "36px",
                    }}
                >
                    Сервисы  помогают предпринимателям, маркетологам и агентствам
                    сделать интернет-маркетинг прозрач
                </Typography>
            </Box>
            {!upMd && <Divider sx={{ width: "100%", bgcolor: "white", borderColor: "#00000000" }} />}
            <Typography
                variant="body2"
                sx={{
                    mt: "25px",
                }}
            >Конструктор маркетинговых решений. © 2022</Typography>
        </SectionWrapper>
    );
};