{#if messages.length === 0}

No messages yet

{:else}
{#each messages as msg (msg.id)}
(hoveredId = msg.id)} onmouseleave={() => (hoveredId = null)} onclick={() => handleClick(msg)} onkeydown={(e) => { if (e.key === 'Enter') handleClick(msg); }} >
{msg.from_agent.charAt(0).toUpperCase()}
{msg.from_agent} {#if agentTypes[msg.from_agent] === 'ai'} AI {:else if agentTypes[msg.from_agent] === 'human'} Human {/if} {#if msg.to_agent} {msg.to_agent} {/if} {formatTime(msg.created_at)} {#if msg.status !== 'done'} {msg.status} {/if} {#if msg.priority >= 8} P{msg.priority} {:else if msg.priority >= 5} P{msg.priority} {/if}

{msg.body.length > 300 ? msg.body.slice(0, 300) + '...' : msg.body}

{#if showConversationLink && msg.conversation_id} {/if}
{#if hoveredId === msg.id}
{#if msg.status === 'pending'} {/if}
{/if}
{/each}
{/if}