import { ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { Icon } from '@rneui/base';
import { globalStyles } from '../../modules/styles';
/**
 * POIList props
 *
 * @category Props
 */

/**
  @category Component
 */
const POIList = props => {
  const {
    count,
    pois,
    keyboards,
    onPOIPress
  } = props;
  const onPOIItemPress = poi => {
    onPOIPress?.(poi);
  };
  return /*#__PURE__*/React.createElement(View, {
    style: [styles.container, globalStyles.background]
  }, /*#__PURE__*/React.createElement(View, {
    style: styles.header
  }, /*#__PURE__*/React.createElement(Icon, {
    size: 20,
    name: "search",
    type: "font-awesome"
  }), /*#__PURE__*/React.createElement(Text, {
    style: styles.headerKey
  }, keyboards), /*#__PURE__*/React.createElement(Text, null, "\u7EA6", count, "\u6761\u7ED3\u679C")), /*#__PURE__*/React.createElement(ScrollView, {
    style: styles.list
  }, pois.slice(0, 10).map((p, i) => /*#__PURE__*/React.createElement(TouchableOpacity, {
    key: p.address + i,
    onPress: () => {
      onPOIItemPress(p);
    }
  }, /*#__PURE__*/React.createElement(View, {
    style: styles.listItem,
    key: p.name
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "location-outline",
    type: "ionicon"
  }), /*#__PURE__*/React.createElement(View, {
    style: [globalStyles.colFlex, globalStyles.rowPadding, {
      flex: 1
    }]
  }, /*#__PURE__*/React.createElement(View, {
    style: [globalStyles.rowFlex]
  }, /*#__PURE__*/React.createElement(Text, {
    style: [styles.headerText]
  }, p.name), i === 0 && /*#__PURE__*/React.createElement(Text, null, "\u8DDD\u79BB\u6700\u8FD1")), /*#__PURE__*/React.createElement(View, {
    style: [globalStyles.rowFlex, {
      alignItems: 'center'
    }]
  }, /*#__PURE__*/React.createElement(Text, {
    style: [globalStyles.tipText]
  }, p.type?.split(';')?.slice(1, 2)?.join('/') || ''), /*#__PURE__*/React.createElement(View, {
    style: {
      marginLeft: 10,
      flex: 1
    }
  }, /*#__PURE__*/React.createElement(Text, {
    numberOfLines: 1,
    ellipsizeMode: 'tail',
    style: [globalStyles.tipText]
  }, p.address)))))))));
};
export default POIList;
const styles = StyleSheet.create({
  container: {
    height: '90%',
    padding: 5,
    borderTopLeftRadius: 5,
    borderTopRightRadius: 5
  },
  header: {
    display: 'flex',
    flexDirection: 'row',
    alignItems: 'center',
    paddingTop: 10
  },
  headerKey: {
    color: '#00f',
    flex: 1,
    paddingLeft: 5,
    paddingRight: 5
  },
  headerText: {
    fontWeight: '400'
  },
  list: {
    width: '100%',
    flex: 1
  },
  listItem: {
    flexDirection: 'row',
    alignItems: 'center',
    paddingTop: 10,
    width: '100%'
  }
});
//# sourceMappingURL=POIList.js.map