import React, {useRef} from 'react';
import {Swiper, SwiperSlide} from "swiper/react";
import Image from "../../../../UI/Image";
import product_bitrix from "../../../../image/mainPage/itProducts/bitrix.png";
import product_amo from "../../../../image/mainPage/itProducts/amoCRM.png";
import arrow from '../../../../image/icon/arrow.png'
import {Navigation} from "swiper";
const SliderProducts = () => {
const prevRef = useRef(null)
return (
<div className={'flex items-center'}>
<div ref={prevRef} className={'w-16 invert rotate-180 cursor-pointer'}>
<Image image={arrow} />
</div>
<Swiper
slidesPerView={2}
spaceBetween={40}
modules={[Navigation]}
style={{
margin: '0 3rem'
}}
navigation={{
nextEl: prevRef.current
}}
>
<SwiperSlide>
<div className={'flex items-center'}>
<div className={'w-[20%]'}>
<Image image={product_bitrix} />
</div>
<div className={'text-xl ml-4 w-[80%]'}>Профессиональная система для управления сайтами и интернет магазинами</div>
</div>
</SwiperSlide>
<SwiperSlide>
<div className={'flex items-center'}>
<div className={'w-[20%]'}>
<Image image={product_amo} />
</div>
<div className={'text-xl ml-4 w-[80%]'}>Продвинутая система аналитики для руководителей
</div>
</div>
</SwiperSlide>
<SwiperSlide>
<div className={'flex items-center'}>
<div className={'w-[20%]'}>
<Image image={product_amo} />
</div>
<div className={'text-xl ml-4 w-[80%]'}>Продвинутая система аналитики для руководителей
</div>
</div>
</SwiperSlide>
</Swiper>
<div className={'w-16 invert next'}>
<Image image={arrow} />
</div>
</div>
);
};
export default SliderProducts;
nextEl: prevRef.current
const [ swiper, setSwiper ] = useState();
<Swiper
onSwiper={setSwiper}
...
- ref={prevRef}
+ onClick={() => swiper.slidePrev()}