"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = require("react");
var _CommunityRowImage = _interopRequireDefault(require("../../elements/CommunityRowImage/CommunityRowImage"));
var _enums = require("../../enums");
var _reactNative = require("react-native");
var _CommunityJoinedButtonElement = _interopRequireDefault(require("../../elements/CommunityJoinedButtonElement/CommunityJoinedButtonElement"));
var _CommunityJoinButtonElement = _interopRequireDefault(require("../../elements/CommunityJoinButtonElement/CommunityJoinButtonElement"));
var _CommunityDisplayname = _interopRequireDefault(require("../../elements/CommunityDisplayname/CommunityDisplayname"));
var _CommunityMemeberCount = _interopRequireDefault(require("../../elements/CommunityMemeberCount/CommunityMemeberCount"));
var _styles = require("./styles");
var _CommunityPrivateBadge = _interopRequireDefault(require("../../elements/CommunityPrivateBadge/CommunityPrivateBadge"));
var _CommunityOfficialBadge = _interopRequireDefault(require("../../elements/CommunityOfficialBadge/CommunityOfficialBadge"));
var _feed = require("../../features/feed");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const CommunityRowItem = ({
  pageId = _enums.PageID.WildCardPage,
  componentId = _enums.ComponentID.trending_communities,
  showJoinButton = true,
  community,
  label
}) => {
  var _community$avatar;
  const styles = (0, _styles.useStyles)();
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.container
  }, /*#__PURE__*/React.createElement(_CommunityRowImage.default, {
    pageId: pageId,
    componentId: componentId,
    fileUrl: (_community$avatar = community.avatar) === null || _community$avatar === void 0 ? void 0 : _community$avatar.fileUrl,
    label: label
  }), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.detailWrap
  }, /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.displayName
  }, !community.isPublic && /*#__PURE__*/React.createElement(_CommunityPrivateBadge.default, {
    pageId: pageId,
    componentId: componentId
  }), /*#__PURE__*/React.createElement(_CommunityDisplayname.default, {
    communityName: community.displayName,
    pageId: pageId,
    componentId: componentId
  }), community.isOfficial && /*#__PURE__*/React.createElement(_CommunityOfficialBadge.default, {
    pageId: pageId,
    componentId: componentId
  })), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.detailBottomWrap
  }, /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.detailBottomWrapLeft
  }, /*#__PURE__*/React.createElement(_feed.CommunityCategories, {
    categories: community.categories,
    pageId: pageId,
    componentId: componentId
  }), /*#__PURE__*/React.createElement(_CommunityMemeberCount.default, {
    counts: community.membersCount,
    pageId: pageId,
    componentId: componentId
  })), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.detailBottomWrapRight
  }, showJoinButton && (community.isJoined ? /*#__PURE__*/React.createElement(_CommunityJoinedButtonElement.default, {
    pageId: pageId,
    componentId: componentId,
    communityId: community.communityId
  }) : /*#__PURE__*/React.createElement(_CommunityJoinButtonElement.default, {
    pageId: pageId,
    componentId: componentId,
    communityId: community.communityId
  }))))));
};
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(CommunityRowItem);
//# sourceMappingURL=CommunityRowItem.js.map