import React from 'react';
import { StyleSheet, TouchableOpacity } from 'react-native';
import { useTheme } from 'react-native-paper';
import { ComponentID, PageID, ElementID } from '../../../enums';
import AvatarElement from '../../../elements/CommonElements/AvatarElement';
import ImageElement from '../../../elements/CommonElements/ImageElement';
import TextKeyElement from '../../../elements/TextKeyElement/TextKeyElement';
import TextElement from '../../../elements/CommonElements/TextElement';
const TargetItem = ({
  pageId = PageID.WildCardPage,
  componentId = ComponentID.WildCardComponent,
  avatarElementId = ElementID.WildCardElement,
  displayNameElementId,
  avatarFileId,
  displayName,
  isBadgeShow,
  isPrivate,
  onSelect,
  avatarCustomUrl
}) => {
  const theme = useTheme();
  const styles = StyleSheet.create({
    container: {
      display: 'flex',
      flexDirection: 'row',
      alignItems: 'center',
      paddingHorizontal: 16,
      paddingVertical: 8
    },
    avatar: {
      width: 40,
      height: 40,
      borderRadius: 20,
      marginRight: 12
    },
    displayName: {
      color: theme.colors.base,
      fontSize: 15,
      fontWeight: '600'
    },
    badgeIcon: {
      width: 20,
      height: 20
    },
    lockIcon: {
      width: 20,
      height: 20,
      tintColor: theme.colors.base
    }
  });
  return /*#__PURE__*/React.createElement(TouchableOpacity, {
    onPress: onSelect,
    style: styles.container
  }, /*#__PURE__*/React.createElement(AvatarElement, {
    style: styles.avatar,
    pageID: pageId,
    componentID: componentId,
    elementID: avatarElementId,
    avatarId: avatarFileId,
    targetType: "community",
    avatarCustomUrl: avatarCustomUrl
  }), isPrivate && /*#__PURE__*/React.createElement(ImageElement, {
    componentID: componentId,
    elementID: ElementID.community_private_badge,
    style: styles.lockIcon,
    configKey: "image"
  }), displayNameElementId ? /*#__PURE__*/React.createElement(TextKeyElement, {
    pageID: pageId,
    componentID: componentId,
    elementID: displayNameElementId,
    style: styles.displayName
  }) : /*#__PURE__*/React.createElement(TextElement, {
    pageID: pageId,
    componentID: componentId,
    elementID: ElementID.community_display_name,
    style: styles.displayName,
    text: displayName
  }), isBadgeShow && /*#__PURE__*/React.createElement(ImageElement, {
    componentID: componentId,
    elementID: ElementID.community_official_badge,
    style: styles.badgeIcon,
    configKey: "image"
  }));
};
export default /*#__PURE__*/React.memo(TargetItem);
//# sourceMappingURL=TargetItem.js.map