/**
 * React Native Full App (https://store.enappd.com/product/react-native-full-app)
 *
 * Copyright © 2019-present Enappd. All rights reserved.
 *
 * This source code is licensed as per the terms found in the
 * LICENSE.md file in the root directory of this source tree.
 */
import React from 'react';
import { View, ImageBackground, ScrollView } from 'react-native';
import { Card } from 'native-base';

interface SwipercomponentProps {
  images: any;
  swiperCards: any;
  backgroundImage: any;
  imageStyleSwiper: any;
  swiperView: any;
  contentContainer: any;
}

const Swipercomponent = (props: SwipercomponentProps) => {
  const {
    images,
    swiperCards,
    backgroundImage,
    imageStyleSwiper,
    swiperView,
    contentContainer,
  } = props;

  return (
    <View style={swiperView}>
      <ScrollView
        horizontal
        style={contentContainer}
        showsHorizontalScrollIndicator
        showsVerticalScrollIndicator={false}
        pagingEnabled
        centerContent
        snapToAlignment="center"
      >
        {images.map((items: any, i: number) => {
          return (
            <Card style={swiperCards} key={i}>
              <ImageBackground
                style={backgroundImage}
                source={items.pic}
                imageStyle={imageStyleSwiper}
                resizeMode={'cover'}
              />
            </Card>
          );
        })}
      </ScrollView>
    </View>
  );
};
export default Swipercomponent;
