import NextImage from "next/image"; import NextLink from "next/link"; import ReactPlayer from "react-player"; import IconClose from "../../images/icon-close.svg"; import { getTAUrl } from "../../lib/constants"; import { formatNumbers } from "../../lib/utils"; import { Data } from "../../types/video"; const TA_BASE_URL = getTAUrl(); type VideoPlayerProps = { selectedVideo: Data; handleRemoveVideoPlayer?: () => void; isHome?: boolean; showStats?: boolean; }; const VideoPlayer = ({ selectedVideo, handleRemoveVideoPlayer, isHome = true, showStats = true, }: VideoPlayerProps) => { if (!selectedVideo) return; return ( <> {selectedVideo && (
{showStats ? (
views icon {formatNumbers(selectedVideo.stats.view_count.toString())} | thumbs-up {formatNumbers(selectedVideo.stats.like_count.toString())}

{selectedVideo.title}

) : null}
)} ); }; export default VideoPlayer; function SponsorBlock() { return ( <> {/*
*/}
{/* {% if video.sponsorblock.is_enabled %} */} {/* {% if video.sponsorblock.segments|length == 0 %} */}

This video doesn't have any sponsor segments added. To add a segment go to{" "} this video on YouTube {" "} and add a segment using the{" "} SponsorBlock {" "} extension.

{/* {% elif video.sponsorblock.has_unlocked %} */}

This video has unlocked sponsor segments. Go to{" "} this video on YouTube {" "} and vote on the segments using the{" "} SponsorBlock {" "} extension.

{/* {% endif %} */} {/* {% endif %} */}
); }