0 ? 'border-t border-line pt-4' : ''}>
- {#if editingId === thread.id}
-
-
-
-
-
-
-
- {:else}
-
-
-
- {thread.authorName}
- {timeAgo(thread.createdAt)}
- {#if wasEdited(thread)}
-
- {m.comment_edited_label()}
- {timeAgo(thread.updatedAt)}
-
- {/if}
-
-
{thread.content}
-
- {#if canModify(thread)}
-
-
-
-
- {/if}
-
-
- {#if thread.replies.length === 0 && canComment}
-
-
-
- {/if}
- {/if}
+ {@render commentEntry(thread, thread.id, thread.replies.length === 0)}
{#each thread.replies as reply, ri (reply.id)}
- {#if editingId === reply.id}
-
-
-
-
-
-
-
- {:else}
-
-
-
- {reply.authorName}
- {timeAgo(reply.createdAt)}
- {#if wasEdited(reply)}
-
- {m.comment_edited_label()}
- {timeAgo(reply.updatedAt)}
-
- {/if}
-
-
{reply.content}
-
- {#if canModify(reply)}
-
-
-
-
- {/if}
-
-
- {#if ri === thread.replies.length - 1 && canComment}
-
-
-
- {/if}
- {/if}
+ {@render commentEntry(reply, thread.id, ri === thread.replies.length - 1)}
{/each}
-
+
{#if replyingTo === thread.id}
{/each}
-
+
{#if canComment}