{#each displayItems as displayItem (displayItem.id)} {#if displayItem.type === 'message'} {#if renderMarkdown}
{:else}
{displayItem.text}
{/if} {: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'} {: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}