import { memo } from 'react';
import CommunityRowImage from '../../elements/CommunityRowImage/CommunityRowImage';
import { ComponentID, PageID } from '../../enums';
import { View } from 'react-native';
import CommunityJoinedButtonElement from '../../elements/CommunityJoinedButtonElement/CommunityJoinedButtonElement';
import CommunityJoinButtonElement from '../../elements/CommunityJoinButtonElement/CommunityJoinButtonElement';
import CommunityDisplayname from '../../elements/CommunityDisplayname/CommunityDisplayname';
import CommunityMemeberCount from '../../elements/CommunityMemeberCount/CommunityMemeberCount';
import { useStyles } from './styles';
import CommunityPrivateBadge from '../../elements/CommunityPrivateBadge/CommunityPrivateBadge';
import CommunityOfficialBadge from '../../elements/CommunityOfficialBadge/CommunityOfficialBadge';
import { CommunityCategories } from '../../features/feed';
const CommunityRowItem = ({
  pageId = PageID.WildCardPage,
  componentId = ComponentID.trending_communities,
  showJoinButton = true,
  community,
  label
}) => {
  var _community$avatar;
  const styles = useStyles();
  return /*#__PURE__*/React.createElement(View, {
    style: styles.container
  }, /*#__PURE__*/React.createElement(CommunityRowImage, {
    pageId: pageId,
    componentId: componentId,
    fileUrl: (_community$avatar = community.avatar) === null || _community$avatar === void 0 ? void 0 : _community$avatar.fileUrl,
    label: label
  }), /*#__PURE__*/React.createElement(View, {
    style: styles.detailWrap
  }, /*#__PURE__*/React.createElement(View, {
    style: styles.displayName
  }, !community.isPublic && /*#__PURE__*/React.createElement(CommunityPrivateBadge, {
    pageId: pageId,
    componentId: componentId
  }), /*#__PURE__*/React.createElement(CommunityDisplayname, {
    communityName: community.displayName,
    pageId: pageId,
    componentId: componentId
  }), community.isOfficial && /*#__PURE__*/React.createElement(CommunityOfficialBadge, {
    pageId: pageId,
    componentId: componentId
  })), /*#__PURE__*/React.createElement(View, {
    style: styles.detailBottomWrap
  }, /*#__PURE__*/React.createElement(View, {
    style: styles.detailBottomWrapLeft
  }, /*#__PURE__*/React.createElement(CommunityCategories, {
    categories: community.categories,
    pageId: pageId,
    componentId: componentId
  }), /*#__PURE__*/React.createElement(CommunityMemeberCount, {
    counts: community.membersCount,
    pageId: pageId,
    componentId: componentId
  })), /*#__PURE__*/React.createElement(View, {
    style: styles.detailBottomWrapRight
  }, showJoinButton && (community.isJoined ? /*#__PURE__*/React.createElement(CommunityJoinedButtonElement, {
    pageId: pageId,
    componentId: componentId,
    communityId: community.communityId
  }) : /*#__PURE__*/React.createElement(CommunityJoinButtonElement, {
    pageId: pageId,
    componentId: componentId,
    communityId: community.communityId
  }))))));
};
export default /*#__PURE__*/memo(CommunityRowItem);
//# sourceMappingURL=CommunityRowItem.js.map