import { useEffect, useState } from 'react' import { useTheme } from 'next-themes' import { ChevronRight, Cross } from '@components/icons' import cn from 'clsx' import ClickOutside from '@lib/click-outside' import ThemeIcon from './ThemeIcon' const ThemeSwitcher = () => { const [mounted, setMounted] = useState(false) const [display, setDisplay] = useState(false) const { theme, themes, setTheme } = useTheme() useEffect(() => setMounted(true), []) if (!mounted) return null return ( setDisplay(false)}>
setDisplay(!display)} >
{themes.length && display ? (
    {themes.map((t: string) => (
  • ))}
) : null}
) } export default ThemeSwitcher