import React from 'react';
import { View, Swiper, SwiperItem, Image } from '@tarojs/components';
import { CompDefault, MetaProps } from '../data-channel';
import connect from '../connect';

export interface Props extends MetaProps {}

export interface State {}

const defaultValue: CompDefault<Props, State> = {
  props: {},
  state: {},
  meta: {},
};

/**
 * 区块-轮播图
 */
const BlockSwiper: React.FC<Props> = () => {
  return (
    <View className='wm-swiper-block'>
      <Swiper
        circular
        indicatorDots
        displayMultipleItems={1}
        className='swiper'>
        {[1, 2].map((item) => (
          <SwiperItem>
            <View onClick={() => {}}>
              <Image
                src='https://wanmi-b2b.oss-cn-shanghai.aliyuncs.com/201904171911077875.jpg'
                className='item'
              />
            </View>
          </SwiperItem>
        ))}
      </Swiper>
    </View>
  );
};

export default connect(BlockSwiper, defaultValue);
