/**
 * 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';

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

  return (
    <View style={swiperView}>
      <ScrollView
        horizontal={true}
        style={contentContainer}
        showsHorizontalScrollIndicator={true}
        showsVerticalScrollIndicator={false}
        pagingEnabled={true}
        centerContent={true}
        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;
