{#snippet commentActions(comment: CommentView)} {#if currentUser?.did === comment.authorDid}
{/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}
{#if editingUri !== thread.self.uri} {@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}
{#if editingUri !== reply.uri} {@render commentActions(reply)} {/if}
{/each}
{/if} {#if deleteError}
{/if} {#if replying && currentUser}
{ replying = false; onsubmitted?.(submitted); }} oncancel={() => (replying = false)} />
{:else}
{#if currentUser} {:else} Login to leave a reply {/if}
{/if}