{#if currentThread}

Thread

{#if conversation}

{conversation.subject || 'Conversation #' + conversation.id}

{:else if currentThread.fromAgent}

Reply to {currentThread.fromAgent}

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

Thread history unavailable

You can still send a reply below

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