{#snippet commentActions(comment: CommentView)} {#if currentUser}
{#if currentUser.did === comment.authorDid}
(editingUri = comment.uri)} >
handleDelete(comment)} >
{/if}
{/if} {/snippet} {#snippet commentEditor( comment: CommentView, replyUri: string | undefined, replyCid: string | undefined )}
{ editingUri = null; onedited?.(edited); }} oncancel={() => (editingUri = null)} /> {/snippet}
{#snippet selfEditor()} {@render commentEditor(thread.self, undefined, undefined)} {/snippet}
setReactions(thread.self.uri, next)} editor={editingUri === thread.self.uri ? selfEditor : undefined} /> {#if editingUri !== thread.self.uri && !thread.self.deleted} {@render commentActions(thread.self)} {/if}
{#if thread.replies.length}
{#each thread.replies as reply, i (reply.uri)} {#snippet replyEditor()} {@render commentEditor(reply, thread.self.uri, thread.self.cid)} {/snippet}
setReactions(reply.uri, next)} editor={editingUri === reply.uri ? replyEditor : undefined} /> {#if editingUri !== reply.uri} {@render commentActions(reply)} {/if}
{/each}
{/if} {#if deleteSelected.error}
{/if} {#if thread.self.deleted && !thread.self.cid} {:else if replying && currentUser}
{ replying = false; onsubmitted?.(submitted); }} oncancel={() => (replying = false)} />
{:else}
{#if currentUser}
(replying = true)} > Leave a reply...
{:else}
Login
to leave a reply
{/if}
{/if}