{#if authUserId}
{/if}
{#each rarities as rarity} {/each}
{#if type === 'weapon' && !requiredProficiencies}
{#each proficiencies as prof} {/each}
{/if}
{#if activeQuery.isLoading}
Searching...
{:else if activeQuery.isError}

{activeQuery.error?.message || 'Search failed'}

{:else if searchResults.length > 0}
    {#each searchResults as item (item.id)} {@const owned = searchMode === 'all' && authUserId && isOwned(item)}
  • {/each}
{#if activeQuery.isFetchingNextPage}
Loading more...
{/if} {:else if isEmpty}
{#if searchMode === 'collection'} {#if searchQuery.length > 0} No items match your search {:else} Your collection is empty {/if} {:else if searchQuery.length > 0} No results found {:else} Start typing to search {/if}
{/if}