import { memo } from 'react';
import { View, Text } from 'react-native';
import { useStyles } from './styles';
import AvatarElement from '../../elements/CommonElements/AvatarElement';
import { useAmityComponent } from '../../hooks';
import { ComponentID, ElementID } from '../../enums';
import { star } from '../../../core/assets/icons/xml';
import { SvgXml } from 'react-native-svg';
import { defaultAdAvatarUri } from '../../../core/assets';
const PostAdHeader = ({
  advertiser,
  pageId
}) => {
  const componentId = ComponentID.post_content;
  const {
    accessibilityId,
    themeStyles
  } = useAmityComponent({
    pageId: pageId,
    componentId
  });
  const styles = useStyles(themeStyles);
  if (!advertiser) return null;
  return /*#__PURE__*/React.createElement(View, {
    testID: accessibilityId,
    style: styles.header
  }, /*#__PURE__*/React.createElement(AvatarElement, {
    style: styles.avatar,
    avatarId: advertiser === null || advertiser === void 0 ? void 0 : advertiser.avatarFileId,
    pageID: pageId,
    elementID: ElementID.WildCardElement,
    componentID: componentId,
    defaultAvatar: defaultAdAvatarUri
  }), /*#__PURE__*/React.createElement(View, {
    style: styles.headerRightSection
  }, /*#__PURE__*/React.createElement(Text, {
    numberOfLines: 1,
    style: styles.headerText
  }, advertiser === null || advertiser === void 0 ? void 0 : advertiser.name), /*#__PURE__*/React.createElement(View, {
    style: styles.adBadge
  }, /*#__PURE__*/React.createElement(SvgXml, {
    style: styles.adBadgeIcon,
    xml: star(),
    width: "12",
    height: "12"
  }), /*#__PURE__*/React.createElement(Text, {
    style: styles.adBadgeContent
  }, "Sponsored"))));
};
export default /*#__PURE__*/memo(PostAdHeader);
//# sourceMappingURL=PostAdHeader.js.map