// it has style inside index.scss ---> // Start ProductImage && end ProductImage import React from "react"; import "./index.scss"; import productImg from "./productImg.svg"; const ProductImage = ({ images }) => { console.log(images.length); return (
{images.slice(0, 4).map((image, index) => (
{/* این خط پایین که نوشتم برای این است که ایندکس که جنسش استرینگ است رو به نامبر تبدیل کند */} {Number(index) === 3 && (
+ {images.length - 3}
)}
))}
); }; // {[0, 1, 2, 3, 4].map((item, index) => ( // ))} export default ProductImage; ProductImage.defaultProps = { images: [ { image: productImg, }, { image: productImg, }, { image: productImg, }, { image: productImg, }, { image: productImg, }, ], };