{#if $activeSource}
activeSource.set(null)}>
Sources
{$activeSource.displayName}
{#each (["POPULAR", "LATEST"] as BrowseType[]) as mode}
setMode(mode)}> {mode.charAt(0) + mode.slice(1).toLowerCase()}
{/each} {#if search}
Search
{/if}
e.key === "Enter" && submitSearch()} />
{#if loading}
{#each Array(18) as _}
{/each}
{:else if mangas.length === 0}
No results.
{:else}
{#each mangas as m (m.id)}
{ activeManga.set(m); navPage.set("library"); }} on:contextmenu={(e) => { e.preventDefault(); e.stopPropagation(); ctx = { x: e.clientX, y: e.clientY, manga: m }; }}>
{#if m.inLibrary}
In Library
{/if}
{m.title}
{/each}
{/if} {#if !loading && (page > 1 || hasNextPage)}
page = Math.max(1, page - 1)} disabled={page === 1}>
Prev
{page}
page++} disabled={!hasNextPage}> Next
{/if}
{/if} {#if ctx}
ctx = null} /> {/if}