import { DarkMode, LightMode } from '@mui/icons-material' import { forwardRef } from 'react' import { IconButtonProps } from '@dao-dao/types' import { Theme, useThemeContext } from '../../theme' import { IconButton } from './IconButton' export type ThemeToggleProps = Omit< IconButtonProps, 'Icon' | 'circular' | 'iconClassName' | 'onClick' | 'size' | 'variant' > export const ThemeToggle = forwardRef( function ThemeToggle(props, ref) { const { theme, updateTheme } = useThemeContext() return ( updateTheme(theme === Theme.Dark ? Theme.Light : Theme.Dark) } ref={ref} variant="secondary" /> ) } )