"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _styles = require("../../modules/styles");
var _unit = require("../../utils/unit");
var _themed = require("@rneui/themed");
/**
 * POIDetail props
 *
 * @category Props
 */

/**
  @category Component
 */
const POIDetail = props => {
  const {
    poi
  } = props;
  const distance = (0, _unit.normalizeDistance)(poi.distance);
  return /*#__PURE__*/React.createElement(_reactNative.View, {
    pointerEvents: 'box-none',
    style: styles.container
  }, /*#__PURE__*/React.createElement(_reactNative.View, {
    pointerEvents: 'box-none',
    style: styles.empty
  }), /*#__PURE__*/React.createElement(_reactNative.View, {
    pointerEvents: 'auto',
    style: styles.detail
  }, /*#__PURE__*/React.createElement(_reactNative.View, {
    style: [_styles.globalStyles.rowPadding]
  }, /*#__PURE__*/React.createElement(_reactNative.Text, {
    style: [{
      fontSize: 16,
      marginBottom: 5
    }]
  }, poi.name), /*#__PURE__*/React.createElement(_reactNative.Text, {
    style: [_styles.globalStyles.tipText]
  }, poi.type?.split(';')?.slice(1, 2)?.join('/') || '')), /*#__PURE__*/React.createElement(_themed.Divider, {
    style: [_styles.globalStyles.rowMargin]
  }), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: [{
      marginBottom: 5
    }]
  }, /*#__PURE__*/React.createElement(_reactNative.Text, null, "\u8DDD\u4F60", distance.value, distance.unit)), /*#__PURE__*/React.createElement(_reactNative.View, {
    style: []
  }, /*#__PURE__*/React.createElement(_reactNative.Text, {
    style: [_styles.globalStyles.tipText]
  }, poi.address)), /*#__PURE__*/React.createElement(_themed.Divider, {
    style: [_styles.globalStyles.rowMargin]
  }), /*#__PURE__*/React.createElement(_reactNative.FlatList, {
    data: poi.photos,
    numColumns: 2,
    keyExtractor: e => e.url,
    renderItem: img => /*#__PURE__*/React.createElement(_reactNative.Image, {
      style: styles.image,
      source: {
        uri: img.item.url
      }
    })
  })));
};
var _default = exports.default = POIDetail;
const styles = _reactNative.StyleSheet.create({
  container: {
    height: '90%'
  },
  empty: {
    flex: 1
  },
  detail: {
    backgroundColor: '#fff',
    maxHeight: '50%',
    paddingHorizontal: 5,
    borderTopLeftRadius: 5,
    borderTopRightRadius: 5
  },
  header: {},
  image: {
    aspectRatio: 1,
    flex: 1
  }
});
//# sourceMappingURL=POIDetail.js.map