function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
import React, { useMemo } from 'react';
import { PisellModal } from '@pisell/materials';
import "./index.less";
var GuestOptionsModal = function GuestOptionsModal(props) {
  var open = props.open,
    onCancel = props.onCancel,
    options = props.options,
    _onClick = props.onClick,
    holderItem = props.holderItem;
  var lists = useMemo(function () {
    var _options = _toConsumableArray(options);
    if (!(holderItem !== null && holderItem !== void 0 && holderItem.isGuest)) {
      _options = _options.filter(function (option) {
        return option.key !== 'remove';
      });
    }
    return _options;
  }, [options]);
  return /*#__PURE__*/React.createElement(PisellModal, {
    open: open,
    platform: 'h5',
    closable: true,
    bodyStyle: {
      padding: '0 24px'
    },
    destroyOnClose: true,
    footer: null,
    onCancel: onCancel,
    mobileModalHeight: 'auto',
    className: 'guest-option-modal',
    headerDivider: false
  }, /*#__PURE__*/React.createElement("div", {
    className: "guest-options-wrap"
  }, lists.map(function (item) {
    return /*#__PURE__*/React.createElement("div", {
      key: item.key,
      className: "guest-options-wrap-item ".concat(item.key === 'remove' ? 'remove' : ''),
      onClick: function onClick() {
        return _onClick(item);
      }
    }, item.label);
  })));
};
export default GuestOptionsModal;