File size: 867 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React, { useState } from 'react';
import { API } from "../config";
import ModalVideo from 'react-modal-video';
import './../../node_modules/react-modal-video/scss/modal-video.scss';
const ShowImage = ({ item, url }) =>{ 
    const [isOpen, setOpen] = useState(false);
    return(
    <div className="product-img">
    <div className="d-flex justify-content-center">
    <ModalVideo channel='youtube' autoplay isOpen={isOpen} videoId={item.youtubelink}onClose={() => setOpen(false)} />
    {/* <button className="btn-primary">VIEW DEMO</button> */}
        <img
            src={`${API}/${url}/photo/${item._id}`}
            alt={item.name}
            className="mb-3 img-thumbnail w-100 m-1"
            style={{ maxHeight: "100%", maxWidth: "100%" }}
            onClick={()=> setOpen(true)}
        />
    </div>
    </div>
)
};

export default ShowImage;