// Component con để hiển thị hình ảnh sản phẩm và gallery const ProductImageGallery = ({ images, mainImage, setMainImage, productName, fromPage, isMobile, showCart }) => { const { Modal } = ReactBootstrap; const [showModal, setShowModal] = useState(false); const handleShow = () => setShowModal(true); const handleClose = () => setShowModal(false); if (!images || images.length === 0) { return (

No image available

); } return (
{`Product: { e.target.onerror = null; e.target.src='/static/libs/images/no_image.jpg'; }} /> {fromPage === 'cart' && images?.length > 1 && (
{images?.map((img, key) => ( {`Thumbnail setMainImage(img)} //onError={(e) => { e.target.onerror = null; e.target.src='/static/libs/images/no_image.jpg'; }} /> ))}
)} {productName} {`Enlarged: { e.target.onerror = null; e.target.src='/static/libs/images/no_image.jpg'; }} />
); };