import React, {Component} from 'react';
import {AppRegistry, StyleSheet, Text, Image, View} from 'react-native';

import Swiper from 'react-native-swiper';
import R from '../../assets/R';
import {HEIGHTXD} from '../../Config/Functions';

const styles = StyleSheet.create({
  container: {
    width: '100%',
    height: HEIGHTXD(500),
    marginTop: 25,
    marginBottom: 10,
    borderTopWidth: 0.5,
    borderBottomWidth: 0.5,
    borderBottomColor: R.colors.borderGray,
    borderTopColor: R.colors.borderGray,
    shadowColor: '#000',
    shadowOffset: {
      width: 0,
      height: 1,
    },
    shadowOpacity: 0.25,
    shadowRadius: 2.84,
    elevation: 2,
  },

  text: {
    color: '#fff',
    fontSize: 30,
    fontWeight: 'bold',
  },
});

const SwiperComponent = (props) => {
  return (
    <View style={styles.container}>
      <Swiper style={styles.wrapper} loop={true} autoplay={true}>
        <View>
          <Image
            style={{height: HEIGHTXD(500), width: '100%'}}
            source={{uri: props.listImage[0].url}}
            resizeMode={'cover'}
          />
        </View>
        <View>
          <Image
            style={{height: HEIGHTXD(500), width: '100%'}}
            source={{uri: props.listImage[1].url}}
            resizeMode={'cover'}
          />
        </View>
        <View>
          <Image
            style={{height: HEIGHTXD(500), width: '100%'}}
            source={{uri: props.listImage[2].url}}
            resizeMode={'cover'}
          />
        </View>
      </Swiper>
    </View>
  );
};

export default SwiperComponent;
