import React, { useRef } from 'react' import ReactPlayer from 'react-player' import awsvideoconfig from '../../../aws-video-exports' import styled from 'styled-components' import PlayLogo from '../../../assets/logo/logo-play.svg' const ThumbnailContainer = styled.div` position: relative; background-image: ${(props) => props.playing || !props.thumbUrl ? 'none' : `url(${props.thumbUrl})`}; background-position: center; background-repeat: no-repeat; background-size: cover; width: ${({ width }) => width}px; height: ${({ height }) => height}px; border-radius: ${(props) => (props.hover ? '10px 10px 0 0' : '10px')}; overflow: hidden; video { object-fit: cover; } ` const TransparentOverlay = styled.div` position: absolute; display: flex; justify-content: center; align-items: center; background-color: rgba(50, 50, 50, 0.5); width: 100%; height: 100%; border-top-right-radius: 10px; top: 0; transition: opacity 200ms; opacity: ${(props) => (props.visible ? 1 : 0)}; ` const Thumbnail = ({ video, videoStatus, loadVideo = true, width, height }) => { const playerRef = useRef(null) return ( {loadVideo && ( )} ) } export default Thumbnail