import useLocalSettingsStore from "@/store/localSettings"; import { useEffect, useState } from "react"; type Props = { className?: string; }; export default function ToggleDarkMode({ className }: Props) { const { settings, updateSettings } = useLocalSettingsStore(); const [theme, setTheme] = useState(localStorage.getItem("theme")); const handleToggle = (e: any) => { setTheme(e.target.checked ? "dark" : "light"); }; useEffect(() => { updateSettings({ theme: theme as string }); }, [theme]); return (