{#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} {project.name} {/if}

{/if}
{#each [['list', 'Liste'], ['board', 'Board'], ['calendar', 'Kalender']] as [value, label]} {/each}
{#if !project.is_inbox} {/if} {#if isOwner && !project.is_inbox} {/if}
{#if showShare}
{#if isOwner}
{#if inviteLink} {/if} {#if inviteError}

{inviteError}

{/if} {/if}
{/if} {#if canEdit} {/if} {#if mode === 'board'} {:else if mode === 'calendar'} {:else}
{#each sections as section (section.id)} {@const tasks = open.filter((t) => t.section_id === section.id)}
{#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}

Tom

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

Ingenting her endnu.

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

Du kan se dette projekt, men ikke ændre det.

{/if} {:else}

Projektet findes ikke, eller du har ikke adgang til det.

{/if}