{#if comments.length > 0}
Comments ({comments.length})
{#each Array.from(groupedComments.entries()) as [target, targetComments]}
toggleSection(target)} >
{#if expandedSections.has(target)}
{:else}
{/if}
{getTargetLabel(target)}
{targetComments.length} {targetComments.length === 1 ? 'comment' : 'comments'}
{#if expandedSections.has(target)}
{#each targetComments as comment (comment.id)}
{getDisplayName(comment.pubkey)}
{formatTimestamp(comment.created_at || 0)}
{@render basicMarkup(comment.content)}
{/each}
{/if}
{/each} {#if groupedComments.size === 0 && comments.length > 0}
Comments loaded but couldn't determine their targets
{/if}
{/if}