{#if title}
{title}
{:else}
{/if} {#if showViewToggle && items.length > 0}
library.setViewMode("grid")} class="p-2 rounded transition-colors {$viewMode === 'grid' ? 'bg-[var(--color-jellyfin)] text-white' : 'text-gray-400 hover:bg-white/10 hover:text-white'}" aria-label="Grid view" title="Grid view" >
library.setViewMode("list")} class="p-2 rounded transition-colors {$viewMode === 'list' ? 'bg-[var(--color-jellyfin)] text-white' : 'text-gray-400 hover:bg-white/10 hover:text-white'}" aria-label="List view" title="List view" >
{/if}
{#if loading}
{#each Array(6) as _}
{/each}
{:else if items.length === 0}
No items found
{:else if !forceGrid && $viewMode === "list"}
{:else}
{#each items as item, index (item.id)}
onItemClick?.(item)} />
{/each}
{/if}