import * as React from 'react';
import { useMenuItem } from '../item/useMenuItem.js';
import { mergeProps } from '../../merge-props/index.js';
export function useMenuRadioItem(params) {
  const {
    checked,
    setChecked,
    ...other
  } = params;
  const {
    getItemProps: getMenuItemProps,
    ...menuItem
  } = useMenuItem(other);
  const getItemProps = React.useCallback(externalProps => {
    return mergeProps({
      role: 'menuitemradio',
      'aria-checked': checked,
      onClick: event => {
        setChecked(event.nativeEvent);
      }
    }, externalProps, getMenuItemProps);
  }, [checked, getMenuItemProps, setChecked]);
  return {
    ...menuItem,
    getItemProps,
    checked
  };
}