ImgSwiperInAddToCartModal.tsx 865 B

1234567891011121314151617181920212223242526
  1. "use client";
  2. import { memo } from "react";
  3. import { Swiper, SwiperSlide } from 'swiper/react';
  4. import Image from "next/image";
  5. import type { ProductMediaType } from "@/components/catalog/type";
  6. const ImgSwiperInAddToCartModal = memo(function ImgSwiperInAddToCartModal({images}: {images: ProductMediaType[];}) {
  7. return (
  8. <Swiper
  9. spaceBetween={10}
  10. slidesPerView={3}
  11. onSlideChange={() => console.log('slide change')}
  12. onSwiper={(swiper) => console.log(swiper)}
  13. >
  14. {images.map((img) => {
  15. return (
  16. <SwiperSlide key={img.id}>
  17. <Image src={img.publicPath} alt={"todo test "} width={175} height={233} />
  18. </SwiperSlide>
  19. );
  20. })}
  21. </Swiper>
  22. );
  23. });
  24. export default ImgSwiperInAddToCartModal;