Fix CORS
This commit is contained in:
@@ -52,6 +52,7 @@ export default function Home() {
|
||||
const [filters, setFilters] = useState<FilterParams>({})
|
||||
const [page, setPage] = useState(0)
|
||||
const [currentTrack, setCurrentTrack] = useState<Track | null>(null)
|
||||
const [isPlaying, setIsPlaying] = useState(false)
|
||||
const [searchQuery, setSearchQuery] = useState("")
|
||||
const [isScanning, setIsScanning] = useState(false)
|
||||
const [scanStatus, setScanStatus] = useState<string>("")
|
||||
@@ -233,10 +234,19 @@ export default function Home() {
|
||||
<div className="flex items-center gap-4">
|
||||
{/* Play button */}
|
||||
<button
|
||||
onClick={() => setCurrentTrack(track)}
|
||||
onClick={() => {
|
||||
if (currentTrack?.id === track.id) {
|
||||
// Toggle play/pause for current track
|
||||
setIsPlaying(!isPlaying)
|
||||
} else {
|
||||
// Switch to new track and start playing
|
||||
setCurrentTrack(track)
|
||||
setIsPlaying(true)
|
||||
}
|
||||
}}
|
||||
className="flex-shrink-0 w-12 h-12 flex items-center justify-center bg-orange-500 hover:bg-orange-600 rounded-full transition-colors shadow-sm"
|
||||
>
|
||||
{currentTrack?.id === track.id ? (
|
||||
{currentTrack?.id === track.id && isPlaying ? (
|
||||
<svg className="w-5 h-5 text-white" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M6 4h4v16H6V4zm8 0h4v16h-4V4z"/>
|
||||
</svg>
|
||||
@@ -347,7 +357,11 @@ export default function Home() {
|
||||
|
||||
{/* Fixed Audio Player at bottom */}
|
||||
<div className="fixed bottom-0 left-0 right-0 z-50">
|
||||
<AudioPlayer track={currentTrack} />
|
||||
<AudioPlayer
|
||||
track={currentTrack}
|
||||
isPlaying={isPlaying}
|
||||
onPlayingChange={setIsPlaying}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user