(open = true) }} />

Search Conversations

{ if (!open) return; setTimeout(() => { if (open) node.focus(); }, 50); }} />
{#if search.isLoading}
{:else if search.data?.length}
{#each search.data as { conversation, messages, titleMatch }, index}
{ goto(`/chat/${conversation._id}`); open = false; }} onkeydown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); goto(`/chat/${conversation._id}`); open = false; } }} onmouseenter={() => (selectedIndex = index)} >
{conversation.title}
{messages.length} matching message{messages.length !== 1 ? 's' : ''} {#if titleMatch} • Title match {/if}
{/each}
{:else if debouncedInput.current.trim()}

No results found for "{debouncedInput.current}"

Try a different search term or mode

{:else}

Start typing to search your conversations

Use ↑↓ to navigate, Enter to select, Esc to close

{/if}