"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ScopeMenu = ScopeMenu;
exports.ScopeUseBox = ScopeUseBox;
function _uiFoundationUi() {
  const data = require("@teambit/ui-foundation.ui.menu");
  _uiFoundationUi = function () {
    return data;
  };
  return data;
}
function _scopeUiHooks() {
  const data = require("@teambit/scope.ui.hooks.scope-context");
  _scopeUiHooks = function () {
    return data;
  };
  return data;
}
function _classnames() {
  const data = _interopRequireDefault(require("classnames"));
  _classnames = function () {
    return data;
  };
  return data;
}
function _react() {
  const data = _interopRequireWildcard(require("react"));
  _react = function () {
    return data;
  };
  return data;
}
function _uiFoundationUiUseBox() {
  const data = require("@teambit/ui-foundation.ui.use-box.dropdown");
  _uiFoundationUiUseBox = function () {
    return data;
  };
  return data;
}
function _uiFoundationUiUseBox2() {
  const data = require("@teambit/ui-foundation.ui.use-box.scope-menu");
  _uiFoundationUiUseBox2 = function () {
    return data;
  };
  return data;
}
function _menuModule() {
  const data = _interopRequireDefault(require("./menu.module.scss"));
  _menuModule = function () {
    return data;
  };
  return data;
}
const _excluded = ["className"];
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
/**
 * scope menu.
 */
function ScopeMenu(_ref) {
  let {
      className
    } = _ref,
    rest = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/_react().default.createElement(_uiFoundationUi().Menu, _extends({}, rest, {
    className: (0, _classnames().default)(_menuModule().default.scopMenu, className)
  }));
}
function ScopeUseBox({
  actionName,
  actionIcon
}) {
  const scope = (0, _react().useContext)(_scopeUiHooks().ScopeContext);
  return /*#__PURE__*/_react().default.createElement(_uiFoundationUiUseBox().UseBoxDropdown, {
    position: "bottom-end",
    className: _menuModule().default.useBox,
    actionIcon: actionIcon,
    actionName: actionName,
    Menu: /*#__PURE__*/_react().default.createElement(_uiFoundationUiUseBox2().Menu, {
      scopeName: scope.name
    })
  });
}

//# sourceMappingURL=menu.js.map