2023-09-12 11:31:20 +00: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 />
|
|
|
|
|
|
2023-09-08 09:17:05 +00:00
|
|
|
<div
|
|
|
|
|
class={`w-full ${$courseMetaDeta.isLoading || $courses ? 'cards-container' : ''} my-4 mx-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}
|
2023-09-24 13:20:04 +00:00
|
|
|
bannerImage={courseData.logo}
|
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}
|
2023-01-03 09:53:20 +01:00
|
|
|
totalLessons={courseData.total_lessons}
|
2021-12-30 22:30:30 +02:00
|
|
|
/>
|
|
|
|
|
{/each}
|
|
|
|
|
{/if}
|
2021-05-07 03:43:37 +03:00
|
|
|
</div>
|
2023-09-12 11:31:20 +00:00
|
|
|
{#if !$courseMetaDeta.isLoading && !$courses.length}
|
2023-09-08 09:17:05 +00:00
|
|
|
<Box className="w-full">
|
|
|
|
|
<CoursesEmptyIcon />
|
|
|
|
|
<h3 class="dark:text-white text-2xl my-5">No Courses Created</h3>
|
|
|
|
|
<p class="dark:text-white w-1/3 text-center">
|
|
|
|
|
Share your knowledge with the world by creating engaging courses for your students.
|
|
|
|
|
</p>
|
|
|
|
|
</Box>
|
|
|
|
|
{/if}
|