You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
880 B
37 lines
880 B
import React, {useState, useEffect} from "react"; |
|
|
|
import "../../../../components/ProductImage/index.scss"; |
|
|
|
import productImg from "../../../../components/ProductImage/product-image.jpg"; |
|
|
|
const Videos = ({ videos }) => { |
|
const [list, setList] = useState([]); |
|
const [activeVideo, setActiveVideo] = useState([]); |
|
|
|
useEffect(() => { |
|
if (videos) { |
|
let mylist = videos?.split(","); |
|
setList(() => mylist); |
|
setActiveVideo(() => mylist[0]); |
|
console.log(videos); |
|
} |
|
}, [videos]); |
|
|
|
return ( |
|
<div className="flex flex-row w-full bg-gray-300" style={{height : 'calc(100vh / 1.5)'}}> |
|
|
|
{/* <img |
|
src={productImg} |
|
alt="" |
|
style={{ height: "calc(100vh)", width: "w-full" }} |
|
className="rounded-md" |
|
/> */} |
|
</div> |
|
); |
|
}; |
|
// {[0, 1, 2, 3, 4].map((item, index) => ( |
|
|
|
// ))} |
|
|
|
export default Videos; |
|
|
|
|