{#if dragged && x && y}
{folders[folderId].name}
{/if}
{#if draggedOver}
{/if}
{ dispatch('open', e.detail); }} >
{ name = folders[folderId].name; edit = true; // focus on the input setTimeout(() => { const input = document.getElementById(`folder-${folderId}-input`); input.focus(); }, 0); }} >
{#if open}
{:else}
{/if}
{#if edit}
{ edit = false; nameUpdateHandler(); }} on:click={(e) => { // Prevent accidental collapse toggling when clicking inside input e.stopPropagation(); }} on:mousedown={(e) => { // Prevent accidental collapse toggling when clicking inside input e.stopPropagation(); }} class="w-full h-full bg-transparent text-gray-500 dark:text-gray-500 outline-none" /> {:else} {folders[folderId].name} {/if}
{ e.stopPropagation(); console.log('clicked'); }} >
{#if folders[folderId].childrenIds || folders[folderId].items?.chat_ids}
{#if folders[folderId]?.childrenIds} {#each folders[folderId]?.childrenIds as childId (`${folderId}-${childId}`)}
{/each} {/if} {#if folders[folderId].items?.chat_ids} {#each folder.items.chat_ids as chatId (chatId)} {chatId} {/each} {/if}
{/if}