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 Icon, { ICON_SIZE_16 } from '../Icon';
/**
 * `MenuBaseItem` component.
 * @since 0.0.60
 */

const MenuBaseItem = ({
  baseClassName,
  className,
  children,
  icon,
  label,
  component: Component,
  ...props
}) => /*#__PURE__*/React.createElement(Component, _extends({
  className: classNames(baseClassName, className)
}, props), /*#__PURE__*/React.createElement("div", {
  className: "".concat(baseClassName, "-icon")
}, Icon.create(icon, {
  size: ICON_SIZE_16
})), /*#__PURE__*/React.createElement("div", {
  className: "".concat(baseClassName, "-content")
}, children), /*#__PURE__*/React.createElement("div", {
  className: "".concat(baseClassName, "-label")
}, label));

MenuBaseItem.propTypes = {
  /**
   * Icon
   * @since 0.0.60
   */
  icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.element]),

  /**
   * Right label of item.
   * @since 0.0.60
   */
  label: PropTypes.node,

  /**
   * Content of the `MenuBaseItem`.
   * @since 0.0.60
   */
  children: PropTypes.node,

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

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

  /**
   * Component to render as the root element. Useful when rendering a `MenuBaseItem` as other component or tag.
   * @since 1.9.1
   */
  component: PropTypes.elementType
};
MenuBaseItem.defaultProps = {
  icon: null,
  label: null,
  children: null,
  className: null,
  baseClassName: "".concat(CLS_PREFIX, "menu__base-item"),
  component: 'div'
};
export default MenuBaseItem;