diff --git a/components/mode-toggle.tsx b/components/mode-toggle.tsx new file mode 100644 index 0000000..8106adf --- /dev/null +++ b/components/mode-toggle.tsx @@ -0,0 +1,77 @@ +"use client"; + +import * as React from "react"; +import { useTheme } from "next-themes"; +import { MoonIcon } from "lucide-react"; +import { IconSunLow } from "@tabler/icons-react"; +import { motion } from "framer-motion"; + +export function ModeToggle() { + const { theme, setTheme } = useTheme(); + + const [isClient, setIsClient] = React.useState(false); + + React.useEffect(() => { + setIsClient(true); + console.log("Theme initialized:", theme); + }, []); + + React.useEffect(() => { + console.log("Theme changed to:", theme); + }, [theme]); + + return ( + isClient && ( + + ) + ); +}