import React, { useRef, useState } from "react"; const SingleAudioPlayer = ({ src }) => { const audioRef = useRef(null); const [isPlaying, setIsPlaying] = useState(false); const togglePlay = () => { const audio = audioRef.current; if (!audio) return; if (isPlaying) { audio.pause(); } else { audio.play().catch((e) => { console.warn("Playback error:", e); }); } setIsPlaying(!isPlaying); }; const handleEnded = () => { setIsPlaying(false); }; return (