import { SafeAreaView } from 'react-native-safe-area-context';
import Header from './components/Header';
import { useMembership } from './hooks/useMembership';
import { useStyles } from './styles';
import Tabs from '../../../../core/components/Tabs';
import MemberList from './components/MemberList';
import ModeratorList from './components/ModeratorList';
import { checkEditCommunityPermission } from '../../../utils/permissions';
const CommunityMembership = ({
  community
}) => {
  const {
    styles
  } = useStyles();
  const {
    onAddMember,
    activeTab,
    setActiveTab
  } = useMembership({
    community
  });
  return /*#__PURE__*/React.createElement(SafeAreaView, {
    style: styles.container,
    edges: ['top']
  }, /*#__PURE__*/React.createElement(Header, {
    onAddMember: checkEditCommunityPermission(community.communityId) ? onAddMember : undefined
  }), /*#__PURE__*/React.createElement(Tabs, {
    variant: "underline",
    activeTab: activeTab,
    onChangeTab: setActiveTab
  }, /*#__PURE__*/React.createElement(Tabs.List, null, /*#__PURE__*/React.createElement(Tabs.Tab, {
    value: "members",
    type: "body"
  }, "Members"), /*#__PURE__*/React.createElement(Tabs.Tab, {
    value: "moderators",
    type: "body"
  }, "Moderators")), /*#__PURE__*/React.createElement(Tabs.Content, {
    value: "members"
  }, /*#__PURE__*/React.createElement(MemberList, {
    community: community
  })), /*#__PURE__*/React.createElement(Tabs.Content, {
    value: "moderators"
  }, /*#__PURE__*/React.createElement(ModeratorList, {
    community: community
  }))));
};
export default CommunityMembership;
//# sourceMappingURL=Membership.js.map