function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import React from 'react';
import { View, TouchableOpacity, Image, Text, StatusBar } from 'react-native';
import styles from './styles';
import { CloudCAProviderContext } from 'react-native-cloud-ca';
const Header = props => {
  var _headerTheme$backgrou, _headerTheme$backgrou2;
  const {
    label,
    leftIconImage,
    leftIconTouchable,
    goBack,
    rightIconImage,
    rightIconTouchable
  } = props;
  const cloudCAProviderContext = React.useContext(CloudCAProviderContext);
  const {
    headerTheme
  } = cloudCAProviderContext;
  const defaultColor = 'rgba(238, 0, 51, 0.9)';
  const rightImageStyleDefault = {
    ...styles.iconStyle,
    tintColor: 'transparent'
  };
  return /*#__PURE__*/React.createElement(View, {
    style: styles.headerContainer
  }, /*#__PURE__*/React.createElement(StatusBar, {
    backgroundColor: (headerTheme === null || headerTheme === void 0 ? void 0 : headerTheme.overlayColor) || defaultColor
  }), /*#__PURE__*/React.createElement(Image, _extends({}, headerTheme === null || headerTheme === void 0 ? void 0 : headerTheme.backgroundImageProps, {
    style: [styles.headerBackgroundImage, (headerTheme === null || headerTheme === void 0 ? void 0 : (_headerTheme$backgrou = headerTheme.backgroundImageProps) === null || _headerTheme$backgrou === void 0 ? void 0 : _headerTheme$backgrou.style) || {}],
    source: (headerTheme === null || headerTheme === void 0 ? void 0 : headerTheme.imageSource) || require('../../asset/image/BG_Viettel.jpeg'),
    resizeMode: (headerTheme === null || headerTheme === void 0 ? void 0 : (_headerTheme$backgrou2 = headerTheme.backgroundImageProps) === null || _headerTheme$backgrou2 === void 0 ? void 0 : _headerTheme$backgrou2.resizeMode) || 'cover'
  })), /*#__PURE__*/React.createElement(View, {
    style: [styles.overlay, {
      backgroundColor: (headerTheme === null || headerTheme === void 0 ? void 0 : headerTheme.overlayColor) || defaultColor
    }]
  }, /*#__PURE__*/React.createElement(View, {
    style: styles.headerButtonContainer
  }, /*#__PURE__*/React.createElement(TouchableOpacity, _extends({}, leftIconTouchable, {
    onPress: (leftIconTouchable === null || leftIconTouchable === void 0 ? void 0 : leftIconTouchable.onPress) || goBack
  }), /*#__PURE__*/React.createElement(Image, _extends({}, leftIconImage, {
    style: [styles.iconStyle, (leftIconImage === null || leftIconImage === void 0 ? void 0 : leftIconImage.style) || {}],
    source: (leftIconImage === null || leftIconImage === void 0 ? void 0 : leftIconImage.source) || require('../../asset/icon/IC_PREV_ARROW.png')
  }))), /*#__PURE__*/React.createElement(Text, {
    style: styles.headerLabel
  }, label || 'Danh sách thiết bị'), /*#__PURE__*/React.createElement(TouchableOpacity, _extends({}, rightIconTouchable, {
    disabled: (rightIconTouchable === null || rightIconTouchable === void 0 ? void 0 : rightIconTouchable.disabled) || true
  }), /*#__PURE__*/React.createElement(Image, _extends({}, rightIconImage, {
    style: [rightImageStyleDefault, (rightIconImage === null || rightIconImage === void 0 ? void 0 : rightIconImage.style) || {}],
    source: (rightIconImage === null || rightIconImage === void 0 ? void 0 : rightIconImage.source) || require('../../asset/icon/IC_ADD.png')
  }))))));
};
export default Header;
//# sourceMappingURL=Header.js.map