"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _enums = require("../../enums");
var _hooks = require("../../hooks");
var _reactNative = require("react-native");
var _Typography = require("../../../core/components/Typography/Typography");
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); }
const CommunityInfo = ({
  community,
  pageId = _enums.PageID.WildCardPage,
  componentId = _enums.ComponentID.WildCardComponent,
  onPress,
  ...props
}) => {
  const elementId = _enums.ElementID.community_description;
  const {
    isExcluded,
    accessibilityId,
    themeStyles
  } = (0, _hooks.useAmityElement)({
    pageId,
    componentId,
    elementId
  });
  const styles = _reactNative.StyleSheet.create({
    container: {
      flexDirection: 'row',
      alignItems: 'center',
      gap: 12
    },
    statItem: {
      flexDirection: 'row',
      alignItems: 'center',
      gap: 4
    },
    number: {
      color: themeStyles.colors.base
    },
    label: {
      color: themeStyles.colors.baseShade2
    },
    line: {
      height: 20,
      width: 1,
      backgroundColor: themeStyles.colors.baseShade4
    }
  });
  if (isExcluded) return null;
  const {
    style,
    ...rest
  } = props;
  return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
    testID: accessibilityId
  }, rest, {
    style: [styles.container, style]
  }), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.statItem
  }, /*#__PURE__*/React.createElement(_Typography.Typography.BodyBold, {
    style: styles.number
  }, community.postsCount), /*#__PURE__*/React.createElement(_Typography.Typography.Caption, {
    style: styles.label
  }, community.postsCount > 1 ? 'posts' : 'post')), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.line
  }), /*#__PURE__*/React.createElement(_reactNative.TouchableOpacity, {
    onPress: onPress,
    activeOpacity: 0.7,
    hitSlop: 0.8
  }, /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.statItem
  }, /*#__PURE__*/React.createElement(_Typography.Typography.BodyBold, {
    style: styles.number
  }, community.membersCount), /*#__PURE__*/React.createElement(_Typography.Typography.Caption, {
    style: styles.label
  }, community.postsCount > 1 ? 'members' : 'member'))));
};
var _default = exports.default = CommunityInfo;
//# sourceMappingURL=CommunityInfo.js.map