import { forwardRef, MouseEventHandler, ReactNode, Ref } from 'react' import Icon from '@/Components/Icon/Icon' import Switch from '@/Components/Switch/Switch' import { SwitchProps } from '@/Components/Switch/SwitchProps' import { IconType } from '@standardnotes/snjs' import { FOCUSABLE_BUT_NOT_TABBABLE } from '@/Constants/Constants' import { MenuItemType } from './MenuItemType' import RadioIndicator from '../RadioIndicator/RadioIndicator' type MenuItemProps = { type: MenuItemType children: ReactNode onClick?: MouseEventHandler onChange?: SwitchProps['onChange'] onBlur?: (event: { relatedTarget: EventTarget | null }) => void className?: string checked?: boolean icon?: IconType iconClassName?: string tabIndex?: number } const MenuItem = forwardRef( ( { children, onClick, onChange, onBlur, className = '', type, checked, icon, iconClassName, tabIndex, }: MenuItemProps, ref: Ref, ) => { return type === MenuItemType.SwitchButton && typeof onChange === 'function' ? (
  • ) : (
  • ) }, ) export default MenuItem