import { useState } from 'react'; import { Play, Pause, ExternalLink } from 'lucide-react'; export default function MusicPlayer() { const [currentSong, setCurrentSong] = useState(null); const [isPlaying, setIsPlaying] = useState(false); const topSongs2024 = [ { title: "Vampire", artist: "Olivia Rodrigo", cover: "https://images.unsplash.com/photo-1470225620780-dba8ba36b745?w=800&h=800&fit=crop", preview: "https://p.scdn.co/mp3-preview/8ef0ca5ac3afa10a51fa5069e4d5096d84fd428e", spotify: "https://open.spotify.com/track/1kuGVB7EU95pJObxwvfwKS", appleMusic: "https://music.apple.com/us/album/vampire/1694386825?i=1694386826", soundcloud: "https://soundcloud.com/oliviarodrigo/vampire" }, { title: "Last Night", artist: "Morgan Wallen", cover: "https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?w=800&h=800&fit=crop", preview: "https://p.scdn.co/mp3-preview/dd4d8d66b43b46105b5c7d5f746aecc47a45e8d4", spotify: "https://open.spotify.com/track/7K3BhSpAxZBznislvUMVtn", appleMusic: "https://music.apple.com/us/album/last-night/1665491101?i=1665491111", soundcloud: "https://soundcloud.com/morganwallen/last-night" }, { title: "Cruel Summer", artist: "Taylor Swift", cover: "https://images.unsplash.com/photo-1501386761578-eac5c94b800a?w=800&h=800&fit=crop", preview: "https://p.scdn.co/mp3-preview/82b87d7e3ad953075f27d4bf3fb58bb84596a111", spotify: "https://open.spotify.com/track/1BxfuPKGuaTgP7aM0Bbdwr", appleMusic: "https://music.apple.com/us/album/cruel-summer/1468058165?i=1468058172", soundcloud: "https://soundcloud.com/taylorswift/cruel-summer" } ]; const handlePlay = (song) => { if (currentSong?.title === song.title) { setIsPlaying(!isPlaying); } else { setCurrentSong(song); setIsPlaying(true); } }; return (
Listen to previews and open in your favorite music service