"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = require("react");
var _reactNativeLinearGradient = _interopRequireDefault(require("react-native-linear-gradient"));
var _enums = require("../../enums");
var _reactNative = require("react-native");
var _styles = require("./styles");
var _Typography = require("../../../core/components/Typography/Typography");
var _reactNativeSvg = require("react-native-svg");
var _icons = require("../../../core/assets/icons");
var _utils = require("../../utils");
var _hooks = require("../../hooks");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const CommunityRowImagey = ({
  fileUrl,
  pageId = _enums.PageID.WildCardPage,
  componentId = _enums.ComponentID.WildCardComponent,
  label
}) => {
  const elementId = _enums.ElementID.community_row_image;
  const styles = (0, _styles.useStyles)();
  const {
    accessibilityId
  } = (0, _hooks.useAmityElement)({
    pageId,
    componentId,
    elementId
  });
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    testID: accessibilityId,
    style: styles.container
  }, fileUrl ? /*#__PURE__*/React.createElement(_reactNative.Image, {
    source: {
      uri: (0, _utils.getFileUrlWithSize)(fileUrl)
    },
    style: styles.image,
    resizeMode: "cover"
  }) : /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.placeholder
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgXml, {
    xml: (0, _icons.community)(),
    width: 36,
    height: 22
  })), label && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_reactNativeLinearGradient.default, {
    colors: ['rgba(0, 0, 0, 0.4)', 'rgba(0, 0, 0, 0)', 'transparent'],
    style: styles.gradientLayer,
    start: {
      x: 0,
      y: 1
    },
    end: {
      x: 0,
      y: 0
    }
  }), /*#__PURE__*/React.createElement(_Typography.Typography.BodyBold, {
    style: styles.label
  }, label)));
};
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(CommunityRowImagey);
//# sourceMappingURL=CommunityRowImage.js.map