import _extends from "@babel/runtime/helpers/extends";
// Copyright 1999-2020. Plesk International GmbH. All rights reserved.
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { CLS_PREFIX } from '../../constants';
import MenuItem from './MenuItem';
/**
 * `MenuSelectableItem` is a part of [Menu](#!/Menu) component.
 * @since 0.0.57
 */

const MenuSelectableItem = ({
  baseClassName,
  className,
  children,
  selected,
  ...props
}) => /*#__PURE__*/React.createElement(MenuItem, _extends({
  className: classNames(baseClassName, className),
  icon: selected ? 'check-mark' : null,
  role: "menuitemcheckbox",
  "aria-checked": selected ? 'true' : 'false'
}, props), children);

MenuSelectableItem.propTypes = {
  /**
   * Whether item is selected.
   * @since 0.0.57
   */
  selected: PropTypes.bool,

  /**
   * Content of the `MenuSelectableItem`.
   * @since 0.0.57
   */
  children: PropTypes.node,

  /**
   * @ignore
   */
  className: PropTypes.string,

  /**
   * @ignore
   */
  baseClassName: PropTypes.string
};
MenuSelectableItem.defaultProps = {
  selected: false,
  children: null,
  className: null,
  baseClassName: `${CLS_PREFIX}menu__item`
};
export default MenuSelectableItem;