{#if messages.length == 0}
{:else}
{#key chatId} {#each messages as message, messageIdx} {#if !message.deleted}
{#if message.role === 'user'}
deleteMessage(message.id)} user={$user} {message} isFirstMessage={messageIdx === 0} siblings={message.parentId !== null ? history.messages[message.parentId]?.childrenIds ?? [] : Object.values(history.messages) .filter((message) => message.parentId === null) .map((message) => message.id) ?? []} {confirmEditMessage} {showPreviousMessage} {showNextMessage} {copyToClipboard} /> {#if messages.length - 1 === messageIdx && processing !== ''}
{processing}
{/if} {:else}
{/if}
{/if} {/each} {#if bottomPadding}
{/if} {/key}
{/if}