{#each [{ user: album.owner, role: 'owner' }, ...album.albumUsers] as { user, role } (user.id)}

{user.name}

{#if role === 'owner'} {$t('owner')} {:else if role === AlbumUserRole.Viewer} {$t('role_viewer')} {:else} {$t('role_editor')} {/if} {#if user.id in contributorCounts} - {$t('items_count', { values: { count: contributorCounts[user.id] } })} {/if}
{#if isOwned} {#if role === AlbumUserRole.Viewer} handleSetReadonly(user, AlbumUserRole.Editor)} text={$t('allow_edits')} /> {:else} handleSetReadonly(user, AlbumUserRole.Viewer)} text={$t('disallow_edits')} /> {/if} handleRemoveUser(user)} text={$t('remove')} /> {:else if user.id == currentUser?.id} {/if}
{/each}