import React, { useState } from 'react'; import { Music, Sparkles, Search, RefreshCw, Loader2, Play, SkipForward, Volume2 } from 'lucide-react'; export default function SongSuggestionSystem() { const [mood, setMood] = useState(''); const [genre, setGenre] = useState(''); const [similarArtist, setSimilarArtist] = useState(''); const [songLikeFood, setSongLikeFood] = useState(''); const [location, setLocation] = useState(''); const [idealType, setIdealType] = useState(''); const [suggestions, setSuggestions] = useState(''); const [isGenerating, setIsGenerating] = useState(false); const [showResults, setShowResults] = useState(false); const [searchQuery, setSearchQuery] = useState(''); const moods = [ { value: 'happy', emoji: '😊', label: 'Happy' }, { value: 'sad', emoji: '😢', label: 'Sad' }, { value: 'energetic', emoji: '⚡', label: 'Energetic' }, { value: 'relaxed', emoji: '😌', label: 'Relaxed' }, { value: 'romantic', emoji: '💕', label: 'Romantic' }, { value: 'motivated', emoji: '💪', label: 'Motivated' }, { value: 'nostalgic', emoji: '🌅', label: 'Nostalgic' }, { value: 'peaceful', emoji: '🕊️', label: 'Peaceful' } ]; const genres = [ 'Pop', 'Rock', 'Hip Hop', 'R&B', 'Jazz', 'Electronic', 'Country', 'Classical', 'Indie', 'K-Pop', 'Latin', 'Blues', 'Reggae', 'Metal' ]; const buildSearchQuery = () => { let query = `best ${mood || ''} ${genre || 'music'} songs 2025`; if (similarArtist) { query += ` ${similarArtist}`; } if (location) { query += ` ${location}`; } if (idealType) { query += ` ${idealType}`; } const foodDescriptors = { 'spicy': 'intense bold', 'sweet': 'melodic catchy', 'savory': 'complex rich', 'bitter': 'edgy alternative', 'sour': 'experimental', 'umami': 'soulful' }; const foodLower = songLikeFood.toLowerCase().trim(); if (foodDescriptors[foodLower]) { query += ` ${foodDescriptors[foodLower]}`; } return query; }; const generateSuggestions = async () => { setIsGenerating(true); const query = buildSearchQuery(); setSearchQuery(query); setSuggestions('SEARCH_TRIGGER'); setShowResults(true); setIsGenerating(false); }; const resetForm = () => { setMood(''); setGenre(''); setSimilarArtist(''); setSongLikeFood(''); setLocation(''); setIdealType(''); setShowResults(false); setSuggestions(''); setSearchQuery(''); }; return (
{/* Music Player Header */}

AI Music Finder

Discover your perfect soundtrack

{!showResults ? (
{/* Player Controls Bar */}
Configure Your Search
Ready
{/* Mood Selection */}
{moods.map((m) => ( ))}
{/* Genre Selection */}
{/* Similar Artist */}
setSimilarArtist(e.target.value)} placeholder="Taylor Swift, Drake, BTS..." className="w-full p-3 rounded-xl bg-slate-700/50 text-white placeholder-slate-400 border border-slate-600 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
{/* Food Flavor */}
setSongLikeFood(e.target.value)} placeholder="spicy, sweet, savory..." className="w-full p-3 rounded-xl bg-slate-700/50 text-white placeholder-slate-400 border border-slate-600 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
{/* Location */}
setLocation(e.target.value)} placeholder="Tokyo, New York, Seoul..." className="w-full p-3 rounded-xl bg-slate-700/50 text-white placeholder-slate-400 border border-slate-600 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent" />
{/* Ideal Type */}
setIdealType(e.target.value)} placeholder="mysterious and deep, warm and caring, cool and confident..." className="w-full p-3 rounded-xl bg-slate-700/50 text-white placeholder-slate-400 border border-slate-600 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent" />

Describe personality traits - we'll match songs with similar vibes

{/* Search Button */}
) : (
{/* Now Playing Bar */}
Searching...
{/* Search Query Display */}

AI Search Query

{searchQuery}

Ready to discover amazing music!

Claude will now search the web for personalized song recommendations

)}
); }