// @flow
import PropTypes from 'prop-types';
import {
  type ColorPaletteColorNameKey,
  colorPaletteColorNames,
} from '../../../../mixins/branding';
import {
  type TranslatedContent,
  translatedContentPropType,
} from '../../../../types';

export type BackgroundSelector = 'active' | 'hover';

export type ContextMenuListItemProps<ItemType> = {
  item: ItemType,
  onSelect: (item: ItemType) => void,
  closeMenu: () => void,
  colorName?: ColorPaletteColorNameKey,
  danger?: boolean,
  children: TranslatedContent,
};

export const contextMenuListItemPropTypes = {
  item: PropTypes.object.isRequired,
  onSelect: PropTypes.func.isRequired,
  closeMenu: PropTypes.func.isRequired,
  colorName: PropTypes.oneOf(colorPaletteColorNames),
  danger: PropTypes.bool,
  children: translatedContentPropType,
};
