import { useState } from "react"; import { styled, alpha } from "@mui/material/styles"; import Box from "@mui/material/Box"; import AppBar from "@mui/material/AppBar"; import Toolbar from "@mui/material/Toolbar"; import Button from "@mui/material/Button"; import IconButton from "@mui/material/IconButton"; import Container from "@mui/material/Container"; import MenuItem from "@mui/material/MenuItem"; import Drawer from "@mui/material/Drawer"; import MenuIcon from "@mui/icons-material/Menu"; import CloseRoundedIcon from "@mui/icons-material/CloseRounded"; import ThemeSwitch from "../ThemeSwitch"; import { useTheme } from "@mui/material/styles"; import { useSelector } from "react-redux"; import { useLocation, useNavigate } from "react-router-dom"; const StyledToolbar = styled(Toolbar)(({ theme, mode }) => ({ display: "flex", alignItems: "center", justifyContent: "space-between", flexShrink: 0, borderRadius: `calc(${theme.shape.borderRadius}px + 4px)`, backdropFilter: "blur(24px)", border: "1px solid", borderColor: mode === "light" ? alpha(theme.palette.common.black, 0.1) : alpha(theme.palette.common.white, 0.1), backgroundColor: mode === "light" ? alpha(theme.palette.common.white, 0.4) : alpha(theme.palette.common.black, 0.4), boxShadow: theme.shadows[3], padding: "8px 12px", })); const StyledMenuItem = styled(MenuItem)(({ theme }) => ({ fontSize: "1.1rem", margin: theme.spacing(4, 2), })); const AppAppBar = () => { const [open, setOpen] = useState(false); const theme = useTheme(); const mode = useSelector((state) => state.ui.mode); const location = useLocation(); const navigate = useNavigate(); // Debugging: Log the current theme mode console.log("Current theme mode:", mode); const logoSrc = mode === "light" ? "/images/prism-black.png" : "/images/prism-white.png"; const toggleDrawer = (newOpen) => () => { setOpen(newOpen); }; const handleScroll = (id) => { if (location.pathname === "/") { const element = document.getElementById(id); if (element) { element.scrollIntoView({ behavior: "smooth" }); } } else { navigate(`/#${id}`); } }; return ( Prism Logo {/* */} Features Testimonials Highlights FAQ Blog {/* */} ); }; export default AppAppBar;