import { useContext } from 'react'; import { themeContext } from 'src/context/theme-context'; import styles from 'src/styles/modules/components/buttons/themeToggler.module.scss'; type Props = { className: string; }; const ThemeToggler = (props: Props) => { const { theme, setTheme } = useContext(themeContext); const clickHandler = () => { const themeToSet = theme === 'light' ? 'dark' : 'light'; setTheme(themeToSet); }; return ( ); }; export default ThemeToggler;