"use strict";

var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
_Object$defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _reactComponentActivityMenu = _interopRequireDefault(require("@webex/react-component-activity-menu"));
var propTypes = {
  activityTypes: _propTypes.default.array.isRequired,
  onChange: _propTypes.default.func,
  onExit: _propTypes.default.func
};
var defaultProps = {
  onChange: function onChange() {},
  onExit: function onExit() {}
};
function SpaceActivityMenu(_ref) {
  var activityTypes = _ref.activityTypes,
    onChange = _ref.onChange,
    onExit = _ref.onExit;
  function handleChange(activity) {
    return function () {
      return onChange(activity);
    };
  }
  var buttons = activityTypes.map(function (a) {
    return {
      label: a.displayName,
      buttonClassName: a.buttonClassName,
      buttonType: a.buttonType,
      onClick: handleChange(a)
    };
  });
  return /*#__PURE__*/_react.default.createElement(_reactComponentActivityMenu.default, {
    buttons: buttons,
    onExit: onExit,
    showExitButton: true
  });
}
SpaceActivityMenu.propTypes = propTypes;
SpaceActivityMenu.defaultProps = defaultProps;
var _default = exports.default = SpaceActivityMenu;