{#if isOpen}
|
{#if activeTab === 'queue'} {#if currentTrack}
{currentTrack.title} {#if isPlaying}
{/if}
{currentTrack.title}
{currentTrack.artist}
{/if} {#if upcomingTracks.length > 0}
{#each filteredTracks as track, index} {@const originalIndex = upcomingTracks.findIndex(t => t.id === track.id)} {@const isUnavailable = track.available === false}
handleTrackClick(track)} ondragstart={(e) => handleDragStart(e, originalIndex)} ondragover={(e) => handleDragOver(e, originalIndex)} ondragleave={handleDragLeave} ondrop={(e) => handleDrop(e, originalIndex)} ondragend={handleDragEnd} role="button" tabindex={isUnavailable ? -1 : 0} > {originalIndex + 1}
{track.title}
{track.artist}
{track.duration}
{/each} {#if searchQuery && filteredTracks.length === 0}
{$t('player.noTracksMatch', { values: { query: searchQuery } })}
{/if}
{:else if !currentTrack}
🎵
{$t('player.queueEmpty')}
{$t('player.queueEmptyDescription')}
{/if} {:else}
{#if historyTracks.length > 0}
{#each historyTracks.slice(0, historyDisplayCount) as track}
handleHistoryTrackClick(track)} onmouseenter={() => hoveredHistoryTrack = track.id} onmouseleave={() => hoveredHistoryTrack = null} role="button" tabindex="0" > {track.title}
{track.title}
{track.artist}
{track.duration} {#if hoveredHistoryTrack === track.id} {/if}
{/each} {#if historyTracks.length > historyDisplayCount} {/if}
{:else}
{$t('player.noHistoryYet')}
{/if}
{/if}
{#if activeTab === 'queue' && (upcomingTracks.length > 0 || currentTrack)} {/if}
{/if}