{#snippet chevronUp()}
{/snippet} {#snippet chevronDown()}
{/snippet} {#if chats.length > 0}
{#if onsort}
onsort?.('title')} > {$t('chat.history.title')} {#if sortBy === 'title'} {#if sortDir === 'asc'} {@render chevronUp()} {:else} {@render chevronDown()} {/if} {:else}
{@render chevronUp()}
{/if}
onsort?.('updated_at')} > {$t('chat.history.updated')} {#if sortBy === 'updated_at'} {#if sortDir === 'asc'} {@render chevronUp()} {:else} {@render chevronDown()} {/if} {:else}
{@render chevronUp()}
{/if}
{/if} {#each chats as chat (chat.id)}
onopen(chat.id)} onmenu={(e) => openMenu(e, chat.id)} /> {/each} {#if onpagechange}
{/if}
{/if} {#if menuChatId && menuAnchor}
{ if (menuChatId) oncopy(menuChatId); } } ] : []), { label: $t('files.rename'), icon: 'pencil', onclick: () => { if (menuChatId) onrename(menuChatId); } }, { label: $t('chat.history.delete'), icon: 'trash', onclick: () => { if (menuChatId) ondelete(menuChatId); } } ]} onclose={closeMenu} /> {/if}