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); }
import { ComponentID, ElementID, PageID } from '../../enums';
import { useAmityElement } from '../../hooks';
import { StyleSheet, TouchableOpacity } from 'react-native';
import { View } from 'react-native';
import { Typography } from '../../../core/components/Typography/Typography';
const CommunityInfo = ({
  community,
  pageId = PageID.WildCardPage,
  componentId = ComponentID.WildCardComponent,
  onPress,
  ...props
}) => {
  const elementId = ElementID.community_description;
  const {
    isExcluded,
    accessibilityId,
    themeStyles
  } = useAmityElement({
    pageId,
    componentId,
    elementId
  });
  const styles = 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(View, _extends({
    testID: accessibilityId
  }, rest, {
    style: [styles.container, style]
  }), /*#__PURE__*/React.createElement(View, {
    style: styles.statItem
  }, /*#__PURE__*/React.createElement(Typography.BodyBold, {
    style: styles.number
  }, community.postsCount), /*#__PURE__*/React.createElement(Typography.Caption, {
    style: styles.label
  }, community.postsCount > 1 ? 'posts' : 'post')), /*#__PURE__*/React.createElement(View, {
    style: styles.line
  }), /*#__PURE__*/React.createElement(TouchableOpacity, {
    onPress: onPress,
    activeOpacity: 0.7,
    hitSlop: 0.8
  }, /*#__PURE__*/React.createElement(View, {
    style: styles.statItem
  }, /*#__PURE__*/React.createElement(Typography.BodyBold, {
    style: styles.number
  }, community.membersCount), /*#__PURE__*/React.createElement(Typography.Caption, {
    style: styles.label
  }, community.postsCount > 1 ? 'members' : 'member'))));
};
export default CommunityInfo;
//# sourceMappingURL=CommunityInfo.js.map