• {#if canUpdate} {/if} {#if canDelete || type === "share"} {/if} {#if type === "share"} {/if} {#if type !== "share"} {/if}
    {#if open} {/if}
  • {#if menu} (menu = null)} x={menu.x} y={menu.y} items={[ type !== "share" && { label: t("add"), action: () => doAdd(false) }, type !== "share" && { label: t("add_next"), action: () => doAdd(true) }, type !== "share" && { type: "separator" }, lib.isSharingSupported && type !== "share" && { label: t("share"), action: () => { ui.shareItemId = id; ui.shareItemLabel = label; ui.shareItemType = type; }, }, type === "share" && { label: t("copy_link"), action: () => { if (item?.url) navigator.clipboard.writeText(item.url); }, }, ...(type === "album" || type === "artist" ? [ { label: isStarred ? t("unfavorite") : t("favorite"), action: doToggleStar, }, ] : []), ...(type === "playlist" ? [ ...(canUpdate ? [{ label: t("update"), action: doUpdate }] : []), ...(canDelete ? [ { label: t("rename"), action: doRename }, ...(isOwner || auth.admin ? [ { label: isPublicState ? t("make_private") : t("make_public"), action: doTogglePublic, }, ] : []), { label: t("delete"), action: doDelete }, ] : []), ] : []), type === "share" && { label: t("delete"), action: doDelete }, ].filter(Boolean) as any} /> {/if}