import { useEffect, useState } from 'react'
import { useTheme } from 'next-themes'
import { MoonIcon, SunIcon } from '@heroicons/react/outline'
import DropMenu from './DropMenu'
import { MangoIcon } from './icons'
const THEMES = [
{ name: 'Light', icon: },
{ name: 'Dark', icon: },
{ name: 'Mango', icon: },
]
const ThemeSwitch = () => {
const [mounted, setMounted] = useState(false)
const { theme, setTheme } = useTheme()
// When mounted on client, now we can show the UI
useEffect(() => setMounted(true), [])
return (
{mounted ? (
{THEMES.find((t) => t.name === theme).icon}
}
value={theme}
onChange={(theme) => setTheme(theme)}
options={THEMES}
/>
) : (
)}
)
}
export default ThemeSwitch