import { useTheme } from 'next-themes' import { motion as m } from 'framer-motion' import { twMerge } from 'tailwind-merge' const themeMenus = [{ name: 'light' }, { name: 'dark' }, { name: 'system' }] export default function ToggleTheme() { const { theme: currentTheme, setTheme } = useTheme() const handeleNativeTheme = async (val: string) => { switch (val) { case 'light': return await window?.electronAPI.setNativeThemeLight() case 'dark': return await window?.electronAPI.setNativeThemeDark() default: return await window?.electronAPI.setNativeThemeSystem() } } return (
{themeMenus.map((theme, i) => { const isActive = currentTheme === theme.name return (
{isActive ? ( ) : null}
) })}
) }