{#if currentThread}

Thread

{#if parentMessage} {threadReplies.length} {threadReplies.length === 1 ? 'reply' : 'replies'} {:else} Loading... {/if}

{#if loadingThread}
{#each Array(3) as _}
{/each}
{:else if loadError}

Thread history unavailable

{loadError}

{:else if allMessages.length === 0}
No messages in this thread yet
{:else} {#each allMessages as msg, i (msg.id)}
{msg.from_agent.charAt(0).toUpperCase()}
{msg.from_agent} {formatTime(msg.created_at)} {#if msg.status && msg.status !== 'done' && msg.status !== 'pending'} {msg.status} {/if}
{#if msg.attachments && msg.attachments.length > 0}
{#each msg.attachments as att (att.hash)} {/each}
{/if}
{/each} {/if}
{#if error}
{error}
{/if}
{/if}