import slick from 'slick-carousel';
import Swiper, { Navigation, Pagination, Autoplay } from 'swiper';

export default () => {
  const slider = $('.swiper');
  const slideToShow = slider.data('slide-to-show');
  const autoplay = slider.data('autoplay');
  const pause = slider.data('pause');
  const autoplaySpeed = slider.data('autoplay-speed');
  const infiniteLoop = slider.data('loop');
  const autoHeight = slider.data('auto-height');


  console.log('AutoHeight= ' + autoHeight);

  const swiper = new Swiper('.swiper', {
    pagination: true,
    modules: [Navigation, Pagination, Autoplay],
    pagination: {
      el: '.swiper-pagination',
      clickable: true,
    },
    navigation: {
      nextEl: '.swiper-next',
      prevEl: '.swiper-prev',
    },
    slidesPerView: slideToShow ? slideToShow : 1,
    autoplay: autoplay ? true : false,
    loop: infiniteLoop ? true : false,
    speed: autoplaySpeed,
    pauseOnMouseEnter: pause ? true : false,
    autoHeight: autoHeight == true ? true : false,
  });
}