2021-05-06 08:22:25 +03:00
|
|
|
<script>
|
2021-08-29 07:23:19 +03:00
|
|
|
import Box from '../Box/index.svelte';
|
|
|
|
|
import Card from './components/Card/index.svelte';
|
2023-01-03 09:26:08 +01:00
|
|
|
import CardLoader from './components/Card/Loader.svelte';
|
|
|
|
|
import CoursesEmptyIcon from '../Icons/CoursesEmptyIcon.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}
|
2023-01-03 09:26:08 +01:00
|
|
|
<CardLoader />
|
|
|
|
|
<CardLoader />
|
|
|
|
|
<CardLoader />
|
2021-12-30 22:30:30 +02:00
|
|
|
{:else}
|
|
|
|
|
{#each $courses as courseData}
|
|
|
|
|
<Card
|
|
|
|
|
id={courseData.id}
|
|
|
|
|
logo={courseData.logo}
|
2023-01-03 09:26:08 +01:00
|
|
|
bannerImage={courseData.banner_image}
|
2021-12-30 22:30:30 +02:00
|
|
|
title={courseData.title}
|
|
|
|
|
description={courseData.description}
|
|
|
|
|
role_id={courseData.role_id}
|
2023-01-03 09:26:08 +01:00
|
|
|
isPublished={courseData.is_published}
|
|
|
|
|
cost={courseData.cost}
|
|
|
|
|
currency={courseData.currency}
|
2021-12-30 22:30:30 +02:00
|
|
|
/>
|
|
|
|
|
{:else}
|
|
|
|
|
<Box>
|
2023-01-03 09:26:08 +01:00
|
|
|
<CoursesEmptyIcon />
|
|
|
|
|
<h3 class="text-2xl my-5 ">No Courses Created</h3>
|
|
|
|
|
<p class="w-1/3 text-center">
|
|
|
|
|
Share your knowledge with the world by creating engaging courses for
|
|
|
|
|
your students.
|
|
|
|
|
</p>
|
2021-12-30 22:30:30 +02:00
|
|
|
</Box>
|
|
|
|
|
{/each}
|
|
|
|
|
{/if}
|
2021-05-07 03:43:37 +03:00
|
|
|
</div>
|