Add to playlist option in AlbumMenu

This commit is contained in:
Joel C committed 2026-01-22 22:18:06 +01:00
1 parent ee515573a2
commit 3f0f75a9f2
1 file changed
+17 -2
+17 -2
View File
@@ -6,6 +6,7 @@
MoreHorizontal,
ListPlus,
ListEnd,
ListMusic,
Share2,
Download,
Link,
@@ -16,6 +17,7 @@
interface Props {
onPlayNext?: () => void;
onPlayLater?: () => void;
onAddToPlaylist?: () => void;
onShareQobuz?: () => void;
onShareSonglink?: () => void;
onDownload?: () => void;
@@ -28,6 +30,7 @@
let {
onPlayNext,
onPlayLater,
onAddToPlaylist,
onShareQobuz,
onShareSonglink,
onDownload,
@@ -54,9 +57,10 @@
const menuId = Symbol('album-menu');
const hasQueue = $derived(!!(onPlayNext || onPlayLater));
const hasLibrary = $derived(!!onAddToPlaylist);
const hasShare = $derived(!!(onShareQobuz || onShareSonglink));
const hasDownload = $derived(!!onDownload || isAlbumFullyDownloaded);
const hasMenu = $derived(hasQueue || hasShare || hasDownload);
const hasMenu = $derived(hasQueue || hasLibrary || hasShare || hasDownload);
function closeMenu() {
isOpen = false;
@@ -261,7 +265,18 @@
{/if}
{/if}
{#if hasQueue && (hasShare || hasDownload)}
{#if hasQueue && (hasLibrary || hasShare || hasDownload)}
<div class="separator"></div>
{/if}
{#if hasLibrary}
<button class="menu-item" onclick={() => handleAction(onAddToPlaylist)}>
<ListMusic size={14} />
<span>Add to playlist</span>
</button>
{/if}
{#if hasLibrary && (hasShare || hasDownload)}
<div class="separator"></div>
{/if}