{#if !currentUser}
{ currentUser = s; setView("home"); }} />
{:else}
setView(v)} />
{#if view === "home"}
$ // home — @{currentUser.handle} → {userPosts.length} posts · polling every 5s
{#if timelineError}
err: {timelineError}
{/if} {#if timelineLoading && userPosts.length === 0} {:else if userPosts.length === 0}
// timeline is empty. compose your first post →
{:else} {#if threadRoot}
// thread
{#if threadLoading} {:else if threadError}
err: {threadError}
{:else if threadRoot} {#if threadParent && threadParent.uri !== threadRoot.uri}
{/if} {/if}
{/if} {#each userPosts as p (p.uri)} {/each} {#if timelineCursor}
{/if} {/if} {:else if view === "compose"}
$ // compose — @{currentUser.handle} ⌘↵ to post
{:else if view === "user"}
$ // profile — @{selectedHandle}
{:else if view === "profile"} {#if currentUser}
$ // profile — @{currentUser.handle}
{/if} {:else if view === "settings"}
$ // settings @{currentUser?.handle ?? "?"}

// account

handle @{currentUser?.handle ?? "?"}
did {currentUser?.did ?? "?"}
posts cached {userPosts.length}

// backend

app maarcadetweet
version 0.1.0
pds {pdsBase()}
appview {appviewBase()}
{:else if view === "search"}
$ // search —
{#if searchError}
err: {searchError}
{/if} {#if searchLoading} {:else if searchQuery.trim().length === 0}
// type to search…
{:else if searchResults.length === 0}
// no posts match "{searchQuery}"
{:else}
{searchResults.length} result{searchResults.length === 1 ? "" : "s"} for "{searchQuery}"
{#each searchResults as p (p.uri)} {/each} {/if} {/if}
{#if view === "home"} {/if}
{#if toasts.length > 0}
{#each toasts as t (t.id)} {/each}
{/if} {/if}