@@ -7,11 +7,13 @@ import { Radio } from 'lucide-react';
77import { useAudio } from '@/context/AudioContext' ;
88import { useRouter } from 'next/navigation' ;
99import { Modal } from '@/components/common/Modal' ;
10+ import { VideoModal } from '@/components/common/VideoModal' ;
1011
1112export default function LivePage ( ) {
1213 const { isPlaying, closePlayer } = useAudio ( ) ;
1314 const router = useRouter ( ) ;
1415 const [ showAudioConfirm , setShowAudioConfirm ] = React . useState ( false ) ;
16+ const [ selectedVideo , setSelectedVideo ] = React . useState < { id : string ; title : string } | null > ( null ) ;
1517 // Use a ref to track if we've already checked on mount
1618 const hasCheckedAudio = useRef ( false ) ;
1719
@@ -90,11 +92,26 @@ export default function LivePage() {
9092
9193 < div className = "grid md:grid-cols-2 lg:grid-cols-3 gap-6" >
9294 { liveData . past_streams . map ( ( video ) => (
93- < div key = { video . id } className = "bg-white rounded-lg shadow-sm border border-gray-100 overflow-hidden hover:shadow-md transition group" >
94- < div className = "aspect-video bg-gray-100 relative" >
95- { /* Placeholder for actual thumbnail logic */ }
96- < div className = "absolute inset-0 flex items-center justify-center text-gray-400" >
97- < VideoPlayer videoId = { video . youtube_id } />
95+ < div
96+ key = { video . id }
97+ onClick = { ( ) => setSelectedVideo ( { id : video . youtube_id , title : video . title } ) }
98+ className = "bg-white rounded-lg shadow-sm border border-gray-100 overflow-hidden hover:shadow-md transition group cursor-pointer"
99+ >
100+ < div className = "aspect-video bg-gray-100 relative overflow-hidden" >
101+ { /* YouTube Thumbnail */ }
102+ < img
103+ src = { `https://img.youtube.com/vi/${ video . youtube_id } /hqdefault.jpg` }
104+ alt = { video . title }
105+ className = "absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
106+ loading = "lazy"
107+ />
108+ { /* Play Button Overlay */ }
109+ < div className = "absolute inset-0 flex items-center justify-center bg-black/20 group-hover:bg-black/30 transition" >
110+ < div className = "w-16 h-16 bg-red-600 rounded-full flex items-center justify-center shadow-lg group-hover:scale-110 transition" >
111+ < svg className = "w-8 h-8 text-white ml-1" fill = "currentColor" viewBox = "0 0 24 24" >
112+ < path d = "M8 5v14l11-7z" />
113+ </ svg >
114+ </ div >
98115 </ div >
99116 </ div >
100117 < div className = "p-4" >
@@ -131,6 +148,16 @@ export default function LivePage() {
131148 >
132149 Music is currently playing. Would you like to stop it to watch the live stream?
133150 </ Modal >
151+
152+ { /* Video Modal for Past Streams */ }
153+ { selectedVideo && (
154+ < VideoModal
155+ isOpen = { ! ! selectedVideo }
156+ onClose = { ( ) => setSelectedVideo ( null ) }
157+ videoId = { selectedVideo . id }
158+ title = { selectedVideo . title }
159+ />
160+ ) }
134161 </ div >
135162 ) ;
136163}
0 commit comments