import React, { useEffect, useRef, useState } from "react"; import { FaPlay } from 'react-icons/fa'; const SongRow: React.FC<{ song: string }> = ({ song }) => { const [showDeleteConfirm, setShowDeleteConfirm] = useState(false); const buttonRef = useRef(null); useEffect(() => { const handleClickOutside = (event: MouseEvent) => { if (buttonRef.current && !buttonRef.current.contains(event.target as Node)) { setShowDeleteConfirm(false); } }; if (showDeleteConfirm) { document.addEventListener('click', handleClickOutside); } return () => { document.removeEventListener('click', handleClickOutside); }; }, [showDeleteConfirm]); return (
{song}
); }; const SongTable: React.FC = () => { const songs = Array.from({ length: 20 }, (_, index) => `Song ${index + 1}`); return (
{songs.map((song, index) => ( ))}
); }; export default SongTable;