"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _classnames = _interopRequireDefault(require("classnames"));

var _constants = require("../../constants");

var _MenuItem = _interopRequireDefault(require("./MenuItem"));

// Copyright 1999-2020. Plesk International GmbH. All rights reserved.

/**
 * `MenuSelectableItem` is a part of [Menu](#!/Menu) component.
 * @since 0.0.57
 */
const MenuSelectableItem = ({
  baseClassName,
  className,
  children,
  selected,
  ...props
}) => /*#__PURE__*/_react.default.createElement(_MenuItem.default, (0, _extends2.default)({
  className: (0, _classnames.default)(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.default.bool,

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

  /**
   * @ignore
   */
  className: _propTypes.default.string,

  /**
   * @ignore
   */
  baseClassName: _propTypes.default.string
};
MenuSelectableItem.defaultProps = {
  selected: false,
  children: null,
  className: null,
  baseClassName: `${_constants.CLS_PREFIX}menu__item`
};
var _default = MenuSelectableItem;
exports.default = _default;