{#if selection !== undefined && selection.size > 0}
handleTrailsEditDone(true)} onShare={() => handleTrailsEditDone(false)} />
{/if} {#if filter}
{#if selectedDisplayOption !== "table"}
{$_("sort")}
setSortOrder()} >
{/if}
{/if}
{$_("display-as")}
setDisplayOption()} >
{#if loading} {#if selectedDisplayOption === "table"}
()} tableHeader={sortOptions} items={pagination.items} >
{:else} {#each { length: pagination.items } as _, index} {#if selectedDisplayOption === "cards"}
{:else if selectedDisplayOption === "list"}
{/if} {/each} {/if} {:else} {#if trails.length == 0}
{/if} {#if selectedDisplayOption === "table"}
option.value !== "elevation_loss", )} {filter} items={pagination.items} onsort={handleSortUpdate} onTrailSelect={(t) => handleSelectionUpdate(t)} >
{:else} {#each trails as trail}
handleMouseEnter(trail)} onmouseleave={(e) => handleMouseLeave(trail)} > {#if selectedDisplayOption === "cards"}
handleSelectionUpdate(trail)} >
{:else}
handleSelectionUpdate(trail)} >
{/if}
{/each} {/if} {/if}