import * as React from 'react';
import { Platform, I18nManager, View, Image, StyleSheet } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import TouchableRippleNative from '../TouchableRipple/TouchableRipple.native';
const HeaderCloseIcon = _ref => {
  let {
    size = 24,
    color,
    onPress = () => null,
    accessibilityLabel
  } = _ref;
  const iosIconSize = size - 3;
  return /*#__PURE__*/React.createElement(TouchableRippleNative, {
    borderless: true,
    onPress: onPress,
    accessibilityLabel: accessibilityLabel,
    style: styles.touchable,
    rippleColor: color ? color : '#F9F9F9'
    // @ts-expect-error We keep old a11y props for backwards compat with old RN versions
    ,
    accessibilityTraits: 'button',
    accessibilityComponentType: "button",
    accessibilityRole: "button",
    hitSlop: TouchableRippleNative.supported ? {
      top: 10,
      left: 10,
      bottom: 10,
      right: 10
    } : {
      top: 6,
      left: 6,
      bottom: 6,
      right: 6
    }
  }, Platform.OS === 'ios' ? /*#__PURE__*/React.createElement(View, {
    style: [styles.wrapper, {
      width: size + 14,
      height: size + 14,
      transform: [{
        scaleX: I18nManager.isRTL ? -1 : 1
      }]
    }]
  }, /*#__PURE__*/React.createElement(Image, {
    source: require('../../assets/close.png'),
    style: [styles.icon, {
      tintColor: color,
      width: iosIconSize,
      height: iosIconSize
    }]
  })) : /*#__PURE__*/React.createElement(View, {
    style: [styles.wrapper, {
      width: size + 14,
      height: size + 14,
      transform: [{
        scaleX: I18nManager.isRTL ? -1 : 1
      }]
    }]
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "close",
    color: color,
    size: size,
    direction: I18nManager.isRTL ? 'rtl' : 'ltr'
  })));
};
const styles = StyleSheet.create({
  wrapper: {
    alignItems: 'center',
    justifyContent: 'center',
    // backgroundColor: '#F9F9F9',
    borderRadius: 8
  },
  icon: {
    resizeMode: 'contain'
  },
  touchable: {
    // flexGrow: 0,
    justifyContent: 'center',
    alignItems: 'center'
  }
});
export default HeaderCloseIcon;

// @component-docs ignore-next-line
export { HeaderCloseIcon };
//# sourceMappingURL=CloseIcon.js.map