feat(web-player): label each explore result with its kind

This commit is contained in:
2026-07-21 18:13:46 +02:00
parent 787664f97b
commit b75c97a696
3 changed files with 13 additions and 3 deletions
@@ -8,6 +8,7 @@
id: string | number;
title: string;
artist?: string | null;
typeLabel?: string;
coverSrc?: string | null;
coverSize?: 'small' | 'medium' | 'large';
hue: number;
@@ -24,6 +25,7 @@
id,
title,
artist,
typeLabel,
coverSrc,
coverSize = 'large',
hue,
@@ -35,6 +37,8 @@
onContextMenu,
badge
}: Props = $props();
const meta = $derived([typeLabel, artist].filter((part) => !!part).join(' · '));
</script>
<li
@@ -64,11 +68,11 @@
{/if}
<span class="truncate text-fg" {title}>{title}</span>
</div>
{#if badge || artist}
{#if badge || meta}
<div class="mt-0.5 flex min-w-0 items-center gap-1.5">
{@render badge?.()}
{#if artist}
<span class="truncate text-sm text-fg-3" title={artist}>{artist}</span>
{#if meta}
<span class="truncate text-sm text-fg-3" title={meta}>{meta}</span>
{/if}
</div>
{/if}
@@ -8,6 +8,7 @@
title: string;
href?: string;
subtitle?: string;
typeLabel?: string;
releaseYear?: number;
trackCount?: number;
trackIds?: (string | number)[];
@@ -20,6 +21,7 @@
title,
href,
subtitle,
typeLabel,
releaseYear,
trackCount,
trackIds = [],
@@ -29,6 +31,7 @@
const meta = $derived(
[
typeLabel,
subtitle,
releaseYear ? String(releaseYear) : undefined,
trackCount === undefined