import { Image, StyleSheet, Text, View } from 'react-native';
import { useTheme } from '../../contexts/theme';
import { toImageSource } from '../../utils/credential';
const logoHeight = 80;
const paddingHorizontal = 24;
const CredentialCardLogo = ({
  overlay
}) => {
  var _overlay$brandingOver, _overlay$brandingOver2, _ref, _overlay$metaOverlay, _overlay$metaOverlay2;
  const {
    TextTheme
  } = useTheme();
  const styles = StyleSheet.create({
    logoContainer: {
      top: -0.5 * logoHeight,
      left: paddingHorizontal,
      marginBottom: -1 * logoHeight,
      width: logoHeight,
      height: logoHeight,
      backgroundColor: '#ffffff',
      borderRadius: 8,
      justifyContent: 'center',
      alignItems: 'center',
      shadowColor: '#000',
      shadowOffset: {
        width: 1,
        height: 1
      },
      shadowOpacity: 0.3
    }
  });
  return /*#__PURE__*/React.createElement(View, {
    style: styles.logoContainer
  }, (_overlay$brandingOver = overlay.brandingOverlay) !== null && _overlay$brandingOver !== void 0 && _overlay$brandingOver.logo ? /*#__PURE__*/React.createElement(Image, {
    source: toImageSource((_overlay$brandingOver2 = overlay.brandingOverlay) === null || _overlay$brandingOver2 === void 0 ? void 0 : _overlay$brandingOver2.logo),
    style: {
      resizeMode: 'cover',
      width: logoHeight,
      height: logoHeight,
      borderRadius: 8
    }
  }) : /*#__PURE__*/React.createElement(Text, {
    style: [TextTheme.title, {
      fontSize: 0.5 * logoHeight,
      color: '#000'
    }]
  }, (_ref = ((_overlay$metaOverlay = overlay.metaOverlay) === null || _overlay$metaOverlay === void 0 ? void 0 : _overlay$metaOverlay.name) ?? ((_overlay$metaOverlay2 = overlay.metaOverlay) === null || _overlay$metaOverlay2 === void 0 ? void 0 : _overlay$metaOverlay2.issuer) ?? 'C') === null || _ref === void 0 ? void 0 : _ref.charAt(0).toUpperCase()));
};
export default CredentialCardLogo;
//# sourceMappingURL=CredentialCardLogo.js.map