"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _CardWatermark = _interopRequireDefault(require("../../components/misc/CardWatermark"));
var _theme = require("../../contexts/theme");
var _credential = require("../../utils/credential");
var _testable = require("../../utils/testable");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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
  } = (0, _theme.useTheme)();
  const {
    width,
    height
  } = (0, _reactNative.useWindowDimensions)();
  const styles = _reactNative.StyleSheet.create({
    primaryHeaderContainer: {
      paddingHorizontal,
      paddingVertical
    },
    textContainer: {
      color: (0, _credential.credentialTextColor)(ColorPallet, (_overlay$brandingOver = overlay.brandingOverlay) === null || _overlay$brandingOver === void 0 ? void 0 : _overlay$brandingOver.primaryBackgroundColor)
    }
  });
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    testID: (0, _testable.testIdWithKey)('CredentialDetailsPrimaryHeader'),
    style: [styles.primaryHeaderContainer, {
      zIndex: -1
    }]
  }, /*#__PURE__*/React.createElement(_reactNative.View, null, ((_overlay$metaOverlay = overlay.metaOverlay) === null || _overlay$metaOverlay === void 0 ? void 0 : _overlay$metaOverlay.watermark) && /*#__PURE__*/React.createElement(_CardWatermark.default, {
    width: width,
    height: height,
    watermark: (_overlay$metaOverlay2 = overlay.metaOverlay) === null || _overlay$metaOverlay2 === void 0 ? void 0 : _overlay$metaOverlay2.watermark
  }), /*#__PURE__*/React.createElement(_reactNative.Text, {
    testID: (0, _testable.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(_reactNative.Text, {
    testID: (0, _testable.testIdWithKey)('CredentialName'),
    style: [TextTheme.normal, styles.textContainer, {
      lineHeight: 24
    }]
  }, (_overlay$metaOverlay4 = overlay.metaOverlay) === null || _overlay$metaOverlay4 === void 0 ? void 0 : _overlay$metaOverlay4.name)));
};
var _default = exports.default = CredentialDetailPrimaryHeader;
//# sourceMappingURL=CredentialDetailPrimaryHeader.js.map