import React from "react";
import PropTypes from "prop-types";
import { FaAngleDown, FaAngleUp } from "react-icons/fa";
import Button from "../Button";
import "./MenuItemHeader.scss";
const propTypes = {
  className: PropTypes.string,
  onToggle: PropTypes.func.isRequired,
  title: PropTypes.node.isRequired,
  icon: PropTypes.node,
  isOpen: PropTypes.bool
};
function MenuItemHeader(_ref) {
  let {
    className = "wkp-menu-item-header",
    title,
    icon = null,
    isOpen = false,
    onToggle
  } = _ref;
  return /*#__PURE__*/React.createElement(Button, {
    className: "".concat(className).concat(isOpen ? " open" : ""),
    "aria-expanded": isOpen,
    onClick: () => onToggle()
  }, icon && /*#__PURE__*/React.createElement("div", {
    className: "wkp-menu-item-header-icon"
  }, icon), /*#__PURE__*/React.createElement("div", {
    className: "wkp-menu-item-header-title"
  }, title), /*#__PURE__*/React.createElement("div", {
    className: "wkp-menu-item-header-toggler"
  }, isOpen ? /*#__PURE__*/React.createElement(FaAngleUp, null) : /*#__PURE__*/React.createElement(FaAngleDown, null)));
}
MenuItemHeader.propTypes = propTypes;
export default /*#__PURE__*/React.memo(MenuItemHeader);
//# sourceMappingURL=MenuItemHeader.js.map