{#if show_share_button && value !== null && value.length > 0}
{/if}
{#if value !== null && value.length > 0} {@const groupedMessages = groupMessages(value)} {#each groupedMessages as messages, i} {#if messages.length} {@const role = messages[0].role === "user" ? 'user' : 'bot'} {@const avatar_img = avatar_images[role === "user" ? 0 : 1]}
{#if avatar_img}
{role} avatar
{/if}
{/if} {/each} {#if pending_message} {/if} {:else if placeholder !== null}
{/if}