Radio Explorer
{s.title}
{s.frequency} FM
Latest News
{aiContent && ( )}{aiContent}
{news.title}
{news.time} • 4 min read
import React, { useState, useEffect, useMemo } from 'react'; import { Play, Pause, Radio, Tv, Newspaper, Settings, Home, Search, Mic, Volume2, Info, ChevronRight, Share2, Heart, BarChart3, Clock, Globe, Zap, Sparkles, Loader2, MessageSquare } from 'lucide-react'; const apiKey = ""; // Gemini API Key const App = () => { const [activeTab, setActiveTab] = useState('home'); const [isPlaying, setIsPlaying] = useState(false); const [currentStation, setCurrentStation] = useState({ title: "The Morning Beat", frequency: "98.5 FM", host: "Sarah Jenkins", type: "radio", image: "https://images.unsplash.com/photo-1598488035139-bdbb2231ce04?auto=format&fit=crop&w=300&q=80" }); const [isDarkMode, setIsDarkMode] = useState(true); const [aiLoading, setAiLoading] = useState(false); const [aiContent, setAiContent] = useState(null); // --- Gemini API Helper --- const callGemini = async (prompt, systemInstruction = "You are a helpful media assistant.") => { setAiLoading(true); setAiContent(null); let retries = 0; const delays = [1000, 2000, 4000, 8000, 16000]; while (retries < 5) { try { const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-09-2025:generateContent?key=${apiKey}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ contents: [{ parts: [{ text: prompt }] }], systemInstruction: { parts: [{ text: systemInstruction }] } }) }); if (!response.ok) throw new Error('API Error'); const data = await response.json(); const text = data.candidates?.[0]?.content?.parts?.[0]?.text; setAiContent(text); setAiLoading(false); return text; } catch (err) { retries++; if (retries === 5) { setAiContent("Sorry, I couldn't connect to the AI service right now. Please try again later."); setAiLoading(false); } else { await new Promise(res => setTimeout(res, delays[retries - 1])); } } } }; // --- Nigerian Content Mock Data --- const tvChannels = [ { id: 1, title: "Arise News Live", category: "News/Nigeria", viewers: "12K", youtubeId: "vDEnbC0bW9I", // Arise News Live image: "https://images.unsplash.com/photo-1495020689067-958852a7765e?auto=format&fit=crop&w=600&q=80" }, { id: 2, title: "Channels TV Live", category: "News/Nigeria", viewers: "25K", youtubeId: "uL6T70D6_oY", // Channels TV Live image: "https://images.unsplash.com/photo-1585829365234-781f8c484603?auto=format&fit=crop&w=600&q=80" }, { id: 3, title: "Nollywood Cinema", category: "Movies/Nigeria", viewers: "8K", youtubeId: "K9I_R09KAnA", // Placeholder for Nollywood Live content image: "https://images.unsplash.com/photo-1536440136628-849c177e76a1?auto=format&fit=crop&w=600&q=80" }, { id: 4, title: "TVC News Live", category: "News/Nigeria", viewers: "15K", youtubeId: "gL785X_E34M", // TVC News Live image: "https://images.unsplash.com/photo-1504711434969-e33886168f5c?auto=format&fit=crop&w=600&q=80" } ]; const radioStations = [ { id: 1, title: "Cool FM Lagos", frequency: "96.9", host: "Do2dtun", image: "https://images.unsplash.com/photo-1511671782779-c97d3d27a1d4?auto=format&fit=crop&w=300&q=80" }, { id: 2, title: "Beat FM", frequency: "99.9", host: "Osi Suave", image: "https://images.unsplash.com/photo-1493225255756-d9584f8606e9?auto=format&fit=crop&w=300&q=80" }, { id: 3, title: "Wazobia FM", frequency: "95.1", host: "Yaw", image: "https://images.unsplash.com/photo-1459749411177-042180ce673c?auto=format&fit=crop&w=300&q=80" }, ]; // --- UI Components --- const Waveform = ({ playing }) => (
{tvChannels[0].category}
{currentStation.frequency} FM • {currentStation.host}
"{aiContent}"
{station.title}
{station.frequency} FM
Live streams from Lagos & Abuja
Analyzing current broadcast trends...
"{aiContent}"
Premium Member • Nigeria
{s.title}
{s.frequency} FM
{aiContent}
{news.time} • 4 min read