import Swiper from 'swiper';
import SwiperCore, { Navigation, Pagination, Autoplay } from 'swiper/core';
SwiperCore.use([Navigation, Pagination, Autoplay]);

export default () => {
  const partnersSlider = $('.partners-swiper');
  const slidesToView = partnersSlider.data('slides-to-view');
  const autoplaySpeed = partnersSlider.data('autoplay-speed');

  console.log(autoplaySpeed);
  const swiper = new Swiper('.partners-swiper', {
    modules: [Navigation, Pagination, Autoplay],
    freeMode: false,
    slidesPerView: slidesToView,
    breakpoints: {
      320: {
        slidesPerView: 2,
        spaceBetween: 20,
      },
      480: {
        slidesPerView: 3,
        spaceBetween: 30,
      },
      640: {
        slidesPerView: 4,
        spaceBetween: 40,
      },
    768: {
      slidesPerView: slidesToView,
      spaceBetween: 50,
    },
    },
    loop: true,
    speed: autoplaySpeed,
    noSwiping: true,
    allowTouchMove: false,
    disableOnInteraction: false,
    centeredSlides: true,
    autoplay: {
      delay: 1,
    },
  });
}

