import React, { useState, useRef } from 'react';
import { motion } from 'framer-motion';
import { Swiper, SwiperSlide } from 'swiper/react';
import { Navigation, Pagination, Autoplay } from 'swiper/modules';
import { Play, X, ChevronLeft, ChevronRight } from 'lucide-react';
// Import Swiper styles
import 'swiper/css';
import 'swiper/css/navigation';
import 'swiper/css/pagination';
const VideoSwiperGallery = ({ videos }) => {
const [selectedVideo, setSelectedVideo] = useState(null);
const swiperRef = useRef(null);
const displayVideos = videos || [];
if (displayVideos.length === 0) return null;
const getEmbedUrl = (url) => {
if (!url) return '';
let embedUrl = url;
if (url.includes('youtu.be/')) {
embedUrl = url.replace('youtu.be/', 'www.youtube.com/embed/');
} else if (url.includes('youtube.com/watch?v=')) {
embedUrl = url.replace('youtube.com/watch?v=', 'youtube.com/embed/');
}
return embedUrl.split('?')[0] + '?autoplay=1';
};
const VideoCard = ({ video }) => {
const [isHovered, setIsHovered] = useState(false);
return (
{/* Overlay */}
{/* Play Button */}
Discover profiles through their stories