"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
var _Header = _interopRequireDefault(require("./components/Header"));
var _useMembership = require("./hooks/useMembership");
var _styles = require("./styles");
var _Tabs = _interopRequireDefault(require("../../../../core/components/Tabs"));
var _MemberList = _interopRequireDefault(require("./components/MemberList"));
var _ModeratorList = _interopRequireDefault(require("./components/ModeratorList"));
var _permissions = require("../../../utils/permissions");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const CommunityMembership = ({
  community
}) => {
  const {
    styles
  } = (0, _styles.useStyles)();
  const {
    onAddMember,
    activeTab,
    setActiveTab
  } = (0, _useMembership.useMembership)({
    community
  });
  return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, {
    style: styles.container,
    edges: ['top']
  }, /*#__PURE__*/React.createElement(_Header.default, {
    onAddMember: (0, _permissions.checkEditCommunityPermission)(community.communityId) ? onAddMember : undefined
  }), /*#__PURE__*/React.createElement(_Tabs.default, {
    variant: "underline",
    activeTab: activeTab,
    onChangeTab: setActiveTab
  }, /*#__PURE__*/React.createElement(_Tabs.default.List, null, /*#__PURE__*/React.createElement(_Tabs.default.Tab, {
    value: "members",
    type: "body"
  }, "Members"), /*#__PURE__*/React.createElement(_Tabs.default.Tab, {
    value: "moderators",
    type: "body"
  }, "Moderators")), /*#__PURE__*/React.createElement(_Tabs.default.Content, {
    value: "members"
  }, /*#__PURE__*/React.createElement(_MemberList.default, {
    community: community
  })), /*#__PURE__*/React.createElement(_Tabs.default.Content, {
    value: "moderators"
  }, /*#__PURE__*/React.createElement(_ModeratorList.default, {
    community: community
  }))));
};
var _default = exports.default = CommunityMembership;
//# sourceMappingURL=Membership.js.map