"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = require("react");
var _reactNative = require("react-native");
var _styles = require("./styles");
var _AvatarElement = _interopRequireDefault(require("../../elements/CommonElements/AvatarElement"));
var _hooks = require("../../hooks");
var _enums = require("../../enums");
var _xml = require("../../../core/assets/icons/xml");
var _reactNativeSvg = require("react-native-svg");
var _assets = require("../../../core/assets");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const PostAdHeader = ({
  advertiser,
  pageId
}) => {
  const componentId = _enums.ComponentID.post_content;
  const {
    accessibilityId,
    themeStyles
  } = (0, _hooks.useAmityComponent)({
    pageId: pageId,
    componentId
  });
  const styles = (0, _styles.useStyles)(themeStyles);
  if (!advertiser) return null;
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    testID: accessibilityId,
    style: styles.header
  }, /*#__PURE__*/React.createElement(_AvatarElement.default, {
    style: styles.avatar,
    avatarId: advertiser === null || advertiser === void 0 ? void 0 : advertiser.avatarFileId,
    pageID: pageId,
    elementID: _enums.ElementID.WildCardElement,
    componentID: componentId,
    defaultAvatar: _assets.defaultAdAvatarUri
  }), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.headerRightSection
  }, /*#__PURE__*/React.createElement(_reactNative.Text, {
    numberOfLines: 1,
    style: styles.headerText
  }, advertiser === null || advertiser === void 0 ? void 0 : advertiser.name), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: styles.adBadge
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgXml, {
    style: styles.adBadgeIcon,
    xml: (0, _xml.star)(),
    width: "12",
    height: "12"
  }), /*#__PURE__*/React.createElement(_reactNative.Text, {
    style: styles.adBadgeContent
  }, "Sponsored"))));
};
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(PostAdHeader);
//# sourceMappingURL=PostAdHeader.js.map