import IconButton from "@mui/material/IconButton"; import { Moon, Sun } from "lucide-react"; import { setMode } from "@/Features/UI/uiSlice.js"; import { useTheme } from "@mui/material"; import { useDispatch, useSelector } from "react-redux"; import type { RootState } from "@/Types/state"; export const SwitchTheme = () => { const mode = useSelector((state: RootState) => state.ui.mode); const dispatch = useDispatch(); const theme = useTheme(); const handleChange = () => { dispatch(setMode(mode === "light" ? "dark" : "light")); }; return ( {mode === "light" ? ( ) : ( )} ); };