2021-05-06 08:22:25 +03:00
|
|
|
<script>
|
2021-08-29 07:23:19 +03:00
|
|
|
import Box from '../Box/index.svelte';
|
2022-12-30 13:08:54 +01:00
|
|
|
import { Moon } from 'svelte-loading-spinners';
|
2021-08-29 07:23:19 +03:00
|
|
|
import Card from './components/Card/index.svelte';
|
2021-12-30 22:30:30 +02:00
|
|
|
import CopyCourseModal from './components/CopyCourseModal/index.svelte';
|
|
|
|
|
import { courses, courseMetaDeta } from './store';
|
2021-05-06 08:22:25 +03:00
|
|
|
</script>
|
|
|
|
|
|
2021-12-30 22:30:30 +02:00
|
|
|
<CopyCourseModal />
|
|
|
|
|
|
2021-09-17 06:33:49 +03:00
|
|
|
<div
|
|
|
|
|
class="flex items-center justify-center lg:justify-start flex-wrap my-4 m-auto"
|
|
|
|
|
>
|
2021-12-30 22:30:30 +02:00
|
|
|
{#if $courseMetaDeta.isLoading}
|
2021-08-29 07:23:19 +03:00
|
|
|
<Box>
|
2022-12-30 13:08:54 +01:00
|
|
|
<Moon size="60" color="#1d4ed8" unit="px" duration="1s" />
|
2021-08-29 07:23:19 +03:00
|
|
|
</Box>
|
2021-12-30 22:30:30 +02:00
|
|
|
{:else}
|
|
|
|
|
{#each $courses as courseData}
|
|
|
|
|
<Card
|
|
|
|
|
id={courseData.id}
|
|
|
|
|
logo={courseData.logo}
|
|
|
|
|
title={courseData.title}
|
|
|
|
|
description={courseData.description}
|
|
|
|
|
role_id={courseData.role_id}
|
|
|
|
|
/>
|
|
|
|
|
{:else}
|
|
|
|
|
<Box>
|
|
|
|
|
<h3 class="text-2xl text-gray-500">No Course Assigned</h3>
|
|
|
|
|
</Box>
|
|
|
|
|
{/each}
|
|
|
|
|
{/if}
|
2021-05-07 03:43:37 +03:00
|
|
|
</div>
|