import IconButton from "@mui/material/IconButton"; import { AnimatePresence, motion } from "framer-motion"; import { useTheme } from "../../context/ThemeContext"; const sun = ( ); const moon = ( ); /** * Animated dark/light theme toggle: the sun/moon icon crossfades + rotates on * switch. Reads ThemeContext (the single owner of the `data-theme` attribute). */ export default function ThemeToggle() { const { theme, toggleTheme } = useTheme(); const isDark = theme === "dark"; const label = isDark ? "Světlý režim" : "Tmavý režim"; return ( {isDark ? moon : sun} ); }