{#each displayItems as displayItem (displayItem.id)} {#if displayItem.type === 'message'} {#if renderMarkdown}
{:else}
{displayItem.text}
{/if} {:else if displayItem.type === 'visualization'} resolveToolCall(displayItem.call.call_id ?? displayItem.call.id ?? '', approved)} /> {:else if displayItem.type === 'image'} {$i18n.t('Generated {:else if displayItem.type === 'detail_group'}
{#each displayItem.tokens as detailToken, detailIndex} {#if detailToken.attributes?.type === 'tool_calls'} resolveToolCall(detailToken.attributes?.id ?? '', approved)} open={$settings?.expandDetails ?? false} className="w-full" buttonClassName={detailButtonClassName} /> {:else if detailToken.text?.length > 0}
{:else} {/if} {/each}
{:else if displayItem.type === 'file'} {#if displayItem.item?.displayed || ($settings?.machineFileDisplay ?? $settings?.terminalFileDisplay) === 'inline'} {/if} {:else if displayItem.type === 'context_compaction'} {#if displayItem.status !== 'in_progress' || !done} {/if} {:else} {@const detailToken = displayItem.token} {#if detailToken.attributes?.type === 'tool_calls'} resolveToolCall(detailToken.attributes?.id ?? '', approved)} open={$settings?.expandDetails ?? false} className="w-full space-y-2" buttonClassName={detailButtonClassName} /> {:else if detailToken.text?.length > 0}
{:else} {/if} {/if} {/each}