{#if persons.length > 0}
{#each persons as ctx, i (ctx.id)} {@const meta = ctx.meta as PersonMeta | null} {@const subType = (meta?.personSubType ?? 'contact') as PersonSubType} {@const showBirthday = subType === 'family' || subType === 'employee' || subType === 'colleague'} {@const showTenure = subType === 'employee' && !!meta?.joinDate} {@const hasInfo = (showBirthday && !!meta?.birthday) || showTenure}
{#if sortable}
reorderContext(ctx.id, 'up')} disabled={i === 0} title="Nach oben">▲
reorderContext(ctx.id, 'down')} disabled={i === persons.length - 1} title="Nach unten">▼
{/if}
toggleFavorite(ctx.id)} title={ctx.isFavorite ? 'Aus Sidebar entfernen' : 'In Sidebar anzeigen'} >★
goto(`/context/${ctx.id}`)} >
{displayName(ctx.name)}
{subTypeLabels[subType]}
{#if hasInfo}
{#if showBirthday && meta?.birthday}
🎂 {formatDate(meta.birthday)}
{/if} {#if showTenure && meta?.joinDate}
⏱ {tenure(meta.joinDate)}
{/if}
{/if}
requestDelete(ctx.id, displayName(ctx.name))} title="Löschen" >🗑
{/each}
{:else}
Keine Personen vorhanden.
{/if} {#if confirmDeleteId}
confirmDeleteId = null} /> {/if}