import { styled, Switch } from "@mui/material"; const StyledSwitch = styled((props) => ( ))(({ theme }) => ({ position: "absolute", top: 10, right: 10, width: 62, height: 34, padding: 0, zIndex: 10, "& .MuiSwitch-switchBase": { padding: 0, margin: 2, transitionDuration: "300ms", "&.Mui-checked": { transform: "translateX(28px)", color: "#fff", "& + .MuiSwitch-track": { backgroundColor: theme.palette.base.dark, opacity: 1, border: 0, }, "& .MuiSwitch-thumb:before": { backgroundImage: `url('data:image/svg+xml;utf8,')`, }, }, }, "& .MuiSwitch-thumb": { width: 30, height: 30, "&::before": { content: "''", position: "absolute", width: "100%", height: "100%", left: 0, top: 0, backgroundRepeat: "no-repeat", backgroundPosition: "center", backgroundImage: `url('data:image/svg+xml;utf8,')`, transition: `${theme.transitions.create(["background-image"], { duration: "300ms", easing: theme.transitions.easing.easeInOut, })}`, }, }, "& .MuiSwitch-track": { borderRadius: 17, backgroundColor: theme.palette.base.dark, opacity: 1, }, [theme.breakpoints.down("sm")]: { scale: 0.6, top: 5, right: 0, }, })); export const ColorSchemeSwitch = ({ colorScheme, onSwitch }) => { const handleSwitch = (event) => { onSwitch(event.target.checked ? "dark" : "light"); }; return ; };