{#if dragged && x && y}
{title}
{/if}
{ mouseOver = true; }} on:mouseleave={() => { mouseOver = false; }} > {#if confirmEdit}
{ if (doubleClicked) { e.preventDefault(); e.stopPropagation(); await tick(); setTimeout(() => { const input = document.getElementById(`chat-title-input-${id}`); if (input) input.focus(); }, 0); doubleClicked = false; return; } }} />
{:else}
{ openPreview = false; dispatch('select'); if ($selectedFolder) { selectedFolder.set(null); } if ($mobile) { showSidebar.set(false); } // Optimistically mark as read in UI when clicked unread = false; lastReadAt = Date.now() / 1000; }} ondblclick={async (e) => { if (readonly) return; e.preventDefault(); e.stopPropagation(); doubleClicked = true; renameHandler(); }} draggable="false" > {#if ownerUserId}
{/if} {#if active}
{/if}
{#if unread}
{/if}
{title}
{#if (updatedAt ?? createdAt) && !showInlineActions}
{formatTimeAgo((updatedAt ?? createdAt) as number)}
{/if}
{/if} {#if !readonly}
{#if confirmEdit}
{ generateTitleHandler(); }} >
{:else if shiftKey && mouseOver}
{ archiveChatHandler(id); }} type="button" >
{ deleteChatHandler(id); }} type="button" >
{:else}
{ cloneChatHandler(id); }} shareHandler={() => { showShareChatModal = true; }} {moveChatHandler} archiveChatHandler={() => { archiveChatHandler(id); }} {renameHandler} deleteHandler={() => { showDeleteConfirm = true; }} onClose={() => { dispatch('unselect'); }} onPinChange={async () => { dispatch('change'); }} >
{ dispatch('select'); }} >
{#if id === $chatId}
{ showDeleteConfirm = true; }} >
{/if}
{/if}
{/if}