import { StyleSheet, Text, useWindowDimensions, View } from 'react-native';
import CardWatermark from '../../components/misc/CardWatermark';
import { useTheme } from '../../contexts/theme';
import { credentialTextColor } from '../../utils/credential';
import { testIdWithKey } from '../../utils/testable';
const paddingHorizontal = 24;
const paddingVertical = 16;
const logoHeight = 80;
const CredentialDetailPrimaryHeader = ({
  overlay
}) => {
  var _overlay$brandingOver, _overlay$metaOverlay, _overlay$metaOverlay2, _overlay$metaOverlay3, _overlay$metaOverlay4;
  const {
    TextTheme,
    ColorPallet
  } = useTheme();
  const {
    width,
    height
  } = useWindowDimensions();
  const styles = StyleSheet.create({
    primaryHeaderContainer: {
      paddingHorizontal,
      paddingVertical
    },
    textContainer: {
      color: credentialTextColor(ColorPallet, (_overlay$brandingOver = overlay.brandingOverlay) === null || _overlay$brandingOver === void 0 ? void 0 : _overlay$brandingOver.primaryBackgroundColor)
    }
  });
  return /*#__PURE__*/React.createElement(View, {
    testID: testIdWithKey('CredentialDetailsPrimaryHeader'),
    style: [styles.primaryHeaderContainer, {
      zIndex: -1
    }]
  }, /*#__PURE__*/React.createElement(View, null, ((_overlay$metaOverlay = overlay.metaOverlay) === null || _overlay$metaOverlay === void 0 ? void 0 : _overlay$metaOverlay.watermark) && /*#__PURE__*/React.createElement(CardWatermark, {
    width: width,
    height: height,
    watermark: (_overlay$metaOverlay2 = overlay.metaOverlay) === null || _overlay$metaOverlay2 === void 0 ? void 0 : _overlay$metaOverlay2.watermark
  }), /*#__PURE__*/React.createElement(Text, {
    testID: testIdWithKey('CredentialIssuer'),
    style: [TextTheme.label, styles.textContainer, {
      paddingLeft: logoHeight + paddingVertical,
      paddingBottom: paddingVertical,
      lineHeight: 19,
      opacity: 0.8
    }],
    numberOfLines: 1
  }, (_overlay$metaOverlay3 = overlay.metaOverlay) === null || _overlay$metaOverlay3 === void 0 ? void 0 : _overlay$metaOverlay3.issuer), /*#__PURE__*/React.createElement(Text, {
    testID: testIdWithKey('CredentialName'),
    style: [TextTheme.normal, styles.textContainer, {
      lineHeight: 24
    }]
  }, (_overlay$metaOverlay4 = overlay.metaOverlay) === null || _overlay$metaOverlay4 === void 0 ? void 0 : _overlay$metaOverlay4.name)));
};
export default CredentialDetailPrimaryHeader;
//# sourceMappingURL=CredentialDetailPrimaryHeader.js.map