Files
classroomio/src/components/Org/Audience/index.svelte
T

32 lines
913 B
Svelte
Raw Normal View History

2023-04-23 22:28:18 +00:00
<script>
import { onMount } from 'svelte';
2023-05-02 23:55:26 +00:00
import Box from '../../Box/index.svelte';
2023-04-23 22:28:18 +00:00
import AudienceList from './AudienceList.svelte';
2023-05-02 23:55:26 +00:00
import AudienceEmptyIcon from '../../Icons/AudienceEmptyIcon.svelte';
import { getOrgAudience } from '../../../utils/services/org';
import { orgAudience, currentOrg } from '../../../utils/store/org';
2023-04-23 22:28:18 +00:00
let isLoading = false;
onMount(async () => {
isLoading = true;
await getOrgAudience($currentOrg.id);
isLoading = false;
});
</script>
<div
class="flex items-center justify-center lg:justify-start flex-wrap my-4 m-auto"
>
{#if $orgAudience.length || isLoading}
<AudienceList {isLoading} />
{:else}
<Box>
<AudienceEmptyIcon />
<h3 class="text-2xl my-5">No audience to manage!</h3>
<p class="w-1/3 text-center">
Manage all your students here and stay connected with them.
</p>
</Box>
{/if}
</div>