import { clsx } from 'clsx' import { For, onMount, Show } from 'solid-js' import SwiperCore, { Manipulation, Navigation, Pagination } from 'swiper' import { Shout } from '../../../graphql/types.gen' import { ArticleCard } from '../../Feed/ArticleCard' import { Icon } from '../Icon' import { SwiperRef } from './swiper' import styles from './Swiper.module.scss' type Props = { slides: Shout[] title?: string } export const ArticleCardSwiper = (props: Props) => { const mainSwipeRef: { current: SwiperRef } = { current: null } onMount(async () => { const { register } = await import('swiper/element/bundle') register() SwiperCore.use([Pagination, Navigation, Manipulation]) }) return (

{props.title}

0}>
(mainSwipeRef.current = el)} centered-slides={true} observer={true} space-between={20} breakpoints={{ 576: { spaceBetween: 20, slidesPerView: 1.5 }, 992: { spaceBetween: 52, slidesPerView: 1.5 }, }} round-lengths={true} loop={true} speed={800} /* autoplay={{ disableOnInteraction: false, delay: 6000, pauseOnMouseEnter: true }} */ > {(slide, index) => ( // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore )}
mainSwipeRef.current.swiper.slidePrev()} >
mainSwipeRef.current.swiper.slideNext()} >
) }