"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _Typography = require("../../../core/components/Typography/Typography");
var _styles = require("./styles");
var _Avatar = _interopRequireDefault(require("../Avatar"));
var _elements = require("../../elements");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function CategoryChip({
  category,
  onPress
}) {
  var _category$avatar;
  const {
    styles,
    theme
  } = (0, _styles.useStyles)();
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.categoryChip
  }, /*#__PURE__*/React.createElement(_Avatar.default.Category, {
    iconProps: {
      width: 28,
      height: 28
    },
    uri: (_category$avatar = category.avatar) === null || _category$avatar === void 0 ? void 0 : _category$avatar.fileUrl,
    imageStyle: styles.categoryAvatar
  }), /*#__PURE__*/React.createElement(_Typography.Typography.BodyBold, {
    numberOfLines: 1,
    ellipsizeMode: "tail",
    style: styles.categoryName
  }, category.name), onPress && /*#__PURE__*/React.createElement(_elements.CloseButton, {
    onPress: () => onPress(category),
    iconProps: {
      color: theme.colors.baseShade1
    }
  }));
}
var _default = exports.default = CategoryChip;
//# sourceMappingURL=CategoryChip.js.map