"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _legacy = require("@hyperledger/aries-oca/build/legacy");
var _reactNative = require("react-native");
var _credential = require("../../utils/credential");
var _theme = require("../../contexts/theme");
var _testable = require("../../utils/testable");
var _ThemedText = require("../texts/ThemedText");
const CredentialCard11Logo = ({
  noLogoText,
  overlay,
  overlayType,
  elevated
}) => {
  var _overlay$brandingOver, _overlay$brandingOver2;
  const {
    CredentialCardShadowTheme
  } = (0, _theme.useTheme)();
  const {
    width
  } = (0, _reactNative.useWindowDimensions)();
  const padding = width * 0.05;
  const logoHeight = width * 0.12;
  const styles = _reactNative.StyleSheet.create({
    logoContainer: {
      width: logoHeight,
      height: logoHeight,
      backgroundColor: '#ffffff',
      borderRadius: 8,
      justifyContent: 'center',
      alignItems: 'center',
      ...(overlayType === _legacy.BrandingOverlayType.Branding10 && {
        top: padding,
        left: -1 * logoHeight + padding,
        ...CredentialCardShadowTheme
      })
    }
  });
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    style: [styles.logoContainer, {
      elevation: elevated ? 5 : 0
    }]
  }, (_overlay$brandingOver = overlay.brandingOverlay) !== null && _overlay$brandingOver !== void 0 && _overlay$brandingOver.logo ? /*#__PURE__*/React.createElement(_reactNative.Image, {
    source: (0, _credential.toImageSource)((_overlay$brandingOver2 = overlay.brandingOverlay) === null || _overlay$brandingOver2 === void 0 ? void 0 : _overlay$brandingOver2.logo),
    style: {
      resizeMode: 'cover',
      width: logoHeight,
      height: logoHeight,
      borderRadius: 8
    },
    testID: (0, _testable.testIdWithKey)('Logo')
  }) : /*#__PURE__*/React.createElement(_ThemedText.ThemedText, {
    variant: "bold",
    style: {
      fontSize: 0.5 * logoHeight,
      alignSelf: 'center',
      color: '#000'
    },
    testID: (0, _testable.testIdWithKey)('NoLogoText')
  }, noLogoText.charAt(0).toUpperCase()));
};
var _default = exports.default = CredentialCard11Logo;
//# sourceMappingURL=CredentialCard11Logo.js.map