{#each tabs as tab (tab.conversationId)}
onSelect(tab.conversationId)}
onkeydown={(e) => {
if (e.key === "Enter") onSelect(tab.conversationId);
}}
>
{handles.get(tab.conversationId) ?? tab.conversationId}
{#if editingId === tab.conversationId}
e.stopPropagation()}
onkeydown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
commitRename();
} else if (e.key === "Escape") {
e.preventDefault();
cancelRename();
}
}}
onblur={commitRename}
/>
{:else}
{
e.stopPropagation();
startRename(tab);
}}
>
{tab.title}
{/if}
{#if statusFor?.(tab.conversationId) === "active"}
{/if}
{/each}