"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MemberChip = MemberChip;
var _Avatar = _interopRequireDefault(require("../Avatar"));
var _reactNative = require("react-native");
var _styles = require("./styles");
var _elements = require("../../elements");
var _Typography = require("../../../core/components/Typography/Typography");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function MemberChip({
  style,
  member,
  onPress
}) {
  var _member$avatar;
  const {
    styles,
    theme
  } = (0, _styles.useStyles)();
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    style: [styles.memberChip, style]
  }, /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.memberAvatarContainer
  }, /*#__PURE__*/React.createElement(_Avatar.default.User, {
    uri: (_member$avatar = member.avatar) === null || _member$avatar === void 0 ? void 0 : _member$avatar.fileUrl,
    imageStyle: styles.memberAvatar,
    userName: member.displayName || member.userId
  }), onPress && /*#__PURE__*/React.createElement(_reactNative.TouchableOpacity, {
    style: styles.removeButtonContainer
  }, /*#__PURE__*/React.createElement(_elements.CloseButton, {
    onPress: () => onPress(member),
    iconProps: {
      color: theme.colors.background,
      width: 12,
      height: 12
    }
  }))), /*#__PURE__*/React.createElement(_Typography.Typography.Caption, {
    numberOfLines: 1,
    ellipsizeMode: "tail",
    style: styles.memberName
  }, member.displayName || member.userId));
}
//# sourceMappingURL=MemberChip.js.map