import React, { useState } from 'react'; import SongTable from './SongTable'; import NowPlaying from './NowPlaying'; import AddSongPanel from './AddSongPanel'; const App: React.FC = () => { const [isPlaying, setIsPlaying] = useState(false); const [nowPlayingSong, setNowPlayingSong] = useState(null); const [nowPlayingFileName, setNowPlayingFileName] = useState(null); const [songs, setSongs] = useState([]); const handleAddURL = (url: string) => { const urlToAdd = url.trim(); if (urlToAdd) { setSongs([...songs, urlToAdd]); } }; const handleDelete = (index: number) => { setSongs(songs.filter((_, i) => i !== index)); }; const handleSkipTo = (index: number) => { setNowPlayingSong(songs[index]); setNowPlayingFileName(songs[index].split('/').pop() || null); setIsPlaying(true); }; return (
setIsPlaying(!isPlaying)} onStepForward={() => {}} onStepBackward={() => {}} /> {songs.length > 0 ? ( ) : (
Playlist is empty
)}
); }; export default App;