36 lines
1.4 KiB
HTML
36 lines
1.4 KiB
HTML
<div class="card bg-base-300 dropdown-shadow border border-base-300 mt-1" style="max-height:18rem;overflow-y:auto">
|
|
{#if artists.isEmpty()}
|
|
<div class="p-4 text-sm text-center text-base-content/50">No artists found</div>
|
|
{#else}
|
|
{#for artist in artists}
|
|
<div class="flex items-center justify-between p-3 hover:bg-base-200 border-b border-base-300 last:border-b-0 transition-colors">
|
|
<div class="flex-1 min-w-0 mr-2">
|
|
<div class="flex items-center gap-2">
|
|
<span class="font-semibold text-sm">{artist.name}</span>
|
|
{#if artist.type}
|
|
<span class="badge badge-ghost badge-xs">{artist.type}</span>
|
|
{/if}
|
|
</div>
|
|
{#if artist.disambiguation}
|
|
<div class="text-xs text-base-content/50 truncate">{artist.disambiguation}</div>
|
|
{/if}
|
|
{#if artist.area}
|
|
<div class="text-xs text-base-content/40">{artist.area}</div>
|
|
{/if}
|
|
</div>
|
|
<div class="flex-shrink-0">
|
|
{#if artist.alreadyTracked}
|
|
<button class="btn btn-success btn-sm" disabled>✓ Added</button>
|
|
{#else}
|
|
<button class="btn btn-accent btn-sm"
|
|
hx-post="/api/artists/{artist.mbid}/track"
|
|
hx-target="#search-results"
|
|
hx-swap="innerHTML"
|
|
onclick="document.getElementById('search-input').value=''">+ Add</button>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
{/for}
|
|
{/if}
|
|
</div>
|