import React, { useEffect, useState } from 'react'; import { Carousel } from 'primereact/carousel'; import { Galleria } from 'primereact/galleria'; import { Button } from 'primereact/button'; import { Image } from "primereact/image"; import { ProductService } from '../service/ProductService'; import { PhotoService } from '../service/PhotoService'; const MediaDemo = () => { const [products, setProducts] = useState([]); const [images, setImages] = useState([]); const galleriaResponsiveOptions = [ { breakpoint: "1024px", numVisible: 5, }, { breakpoint: "960px", numVisible: 4, }, { breakpoint: "768px", numVisible: 3, }, { breakpoint: "560px", numVisible: 1, }, ]; const carouselResponsiveOptions = [ { breakpoint: "1024px", numVisible: 3, numScroll: 3, }, { breakpoint: "768px", numVisible: 2, numScroll: 2, }, { breakpoint: "560px", numVisible: 1, numScroll: 1, }, ]; useEffect(() => { const productService = new ProductService(); productService.getProductsSmall().then((products) => setProducts(products)); const photoService = new PhotoService(); photoService.getImages().then((images) => setImages(images)); }, []); const carouselItemTemplate = (product) => { return (
{product.name}

{product.name}

${product.price}
{product.inventoryStatus}
); }; const galleriaItemTemplate = (item) => {item.alt} const galleriaThumbnailTemplate = (item) => {item.alt} return (
Carousel
Galleria
Image
galleria
); } const comparisonFn = function (prevProps, nextProps) { return prevProps.location.pathname === nextProps.location.pathname; }; export default React.memo(MediaDemo, comparisonFn);