{#each columns as column (column.id)} {@const tasks = tasksIn(column.id)}
onDragOver(e, column.id)} ondragleave={() => (overColumn = null)} ondrop={(e) => onDrop(e, column.id)} >
{column.name}
{tasks.length}
{#each tasks as task (task.id)}
onDragStart(e, task)} ondragend={() => (draggingId = null)} >
{/each} {#if !tasks.length}
{t('view.emptySection')}
{/if}
{#if canEdit} {#if addingIn === column.id}
addToSection(e, column.id)}>
!newInSection.trim() && (addingIn = null)} onkeydown={(e) => e.key === 'Escape' && (addingIn = null)} />
{:else}
{ addingIn = column.id; newInSection = ''; }}>{t('view.addTask')}
{/if} {/if}
{/each} {#if canEdit}
{#if adding}
!name.trim() && (adding = false)} onkeydown={(e) => e.key === 'Escape' && (adding = false)} />
{:else}
{ adding = true; name = ''; }}>{t('view.addSection')}
{/if}
{/if}