{$t('course.navItem.people.invite_modal.existing_students_title')}

{$t('course.navItem.people.invite_modal.existing_students_description')}

{#if selectedCount > 0}

{$t('audience.selected_count', { count: selectedCount })}

{/if}
{#if isLoading}

{$t('course.navItem.people.invite_modal.loading_existing_students')}

{:else if students.length === 0}

{$t('course.navItem.people.invite_modal.no_existing_students')}

{:else if filteredStudents.length === 0}

{$t('course.navItem.people.invite_modal.no_matching_existing_students')}

{:else} {#each filteredStudents as student (student.profileId)}
student.profileId && toggleStudent(student.profileId)} onkeydown={(event) => { if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); if (student.profileId) toggleStudent(student.profileId); } }} > {student.email}
{/each} {/if}