{#if project}
{#if editing} rename(e.currentTarget)} onkeydown={(e) => { if (e.key === 'Enter') e.currentTarget.blur(); if (e.key === 'Escape') { e.currentTarget.value = project.name; editing = false; } }} /> {:else}

{#if isOwner} {:else} {projectName(project)} {/if}

{/if}
{#each [['list', t('view.list')], ['board', t('view.board')], ['calendar', t('view.calendar')]] as [value, label]} {/each}
{#if showMenu} {/if}
{#if showLog}
{#if !activity.length}

{t('project.noHistory')}

{/if}
{/if} {#if choosingColor}
{#each COLORS as color (color.id)} {/each}
{/if} {#if showShare}
{#if isOwner}
{#if inviteLink} {/if} {#if inviteError}

{inviteError}

{/if} {/if}
{/if} {#if canEdit} {/if} {#if mode === 'board'} (sections = [...sections, section])} /> {:else if mode === 'calendar'} {:else}
onSectionDragOver(e, '')} ondragleave={() => (overSection = null)} ondrop={(e) => onSectionDrop(e, '')} > {#if sections.length && !unsectioned.length}

{t('project.noSection')}

{/if}
{#each sections as section (section.id)} {@const tasks = open.filter((t) => t.section_id === section.id)}
onSectionDragOver(e, section.id)} ondragleave={() => (overSection = null)} ondrop={(e) => onSectionDrop(e, section.id)} >
onSectionDragStart(e, section)} ondragend={clearSectionDrag} ondragover={(e) => onHeadDragOver(e, section)} ondragleave={() => (overSectionEdge = null)} ondrop={(e) => onHeadDrop(e, section)} > {#if renamingSection === section.id}
renameSection(e, section)}> (renamingSection = null)} onkeydown={(e) => e.key === 'Escape' && (renamingSection = null)} />
{:else}

{section.name}

{#if canEdit} {/if} {/if}
{#if !tasks.length}

{t('view.emptySection')}

{/if} {#if canEdit} {#if addingIn === section.id}
addToSection(e, section.id)}> !newInSection.trim() && (addingIn = null)} onkeydown={(e) => e.key === 'Escape' && (addingIn = null)} />
{:else} {/if} {/if}
{/each} {#if completedView.shown && done.length}

{t('view.done')}

{#each done as task (task.id)} {/each}
{/if} {#if canEdit}
{#if addingSection}
!sectionName.trim() && (addingSection = false)} onkeydown={(e) => e.key === 'Escape' && (addingSection = false)} />
{:else} {/if}
{/if} {#if !open.length && !sections.length}

{t('project.nothingHere')}

{/if} {/if} {#if project.role === 'viewer'}

{t('project.readOnly')}

{/if} {#if notes.length || canEdit}

{t('notes.title')}

{#if canEdit} {/if}
{#if !notes.length}

{t('notes.noneInProject')}

{/if}
{/if} {:else if status === 'loading'}
{:else if status === 'denied'}

{t('project.notFound')}

{:else}

{t('project.loadFailed')}

{/if}