2023-09-28 11:45:50 +01:00
|
|
|
<script lang="ts">
|
2023-08-15 14:28:51 +00:00
|
|
|
import { Search } from 'carbon-components-svelte';
|
|
|
|
|
import Tabs from '$lib/components/Tabs/index.svelte';
|
|
|
|
|
import TabContent from '$lib/components/TabContent/index.svelte';
|
2023-09-28 11:45:50 +01:00
|
|
|
import Courses from '$lib/components/Courses/index.svelte';
|
2023-09-29 09:25:32 +01:00
|
|
|
import { courses } from '$lib/components/Courses/store';
|
2023-08-15 14:28:51 +00:00
|
|
|
|
|
|
|
|
const tabs = [
|
|
|
|
|
{
|
2023-09-28 11:45:50 +01:00
|
|
|
label: 'In progress',
|
2023-08-15 14:28:51 +00:00
|
|
|
value: 1
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Complete',
|
2023-09-28 11:45:50 +01:00
|
|
|
value: 2
|
2023-08-15 14:28:51 +00:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
let currentTab = tabs[0].value;
|
2023-09-28 11:45:50 +01:00
|
|
|
|
2023-08-15 14:28:51 +00:00
|
|
|
const onChange =
|
|
|
|
|
(tab = 0) =>
|
|
|
|
|
() =>
|
|
|
|
|
(currentTab = tab);
|
|
|
|
|
</script>
|
|
|
|
|
|
2023-08-24 14:22:34 +00:00
|
|
|
<section class="max-w-6xl mx-auto">
|
2023-08-15 14:28:51 +00:00
|
|
|
<div class="m-2 md:m-5">
|
|
|
|
|
<div role="searchbox" class=" bg-gray-100 w-full md:w-[60%] lg:w-[30%]">
|
|
|
|
|
<Search placeholder="Search courses" class="dark:text-black" />
|
|
|
|
|
</div>
|
|
|
|
|
<h1 class="text-3xl font-semibold my-4">My Learning</h1>
|
|
|
|
|
<Tabs {tabs} {currentTab} {onChange}>
|
|
|
|
|
<slot:fragment slot="content">
|
|
|
|
|
<TabContent value={tabs[0].value} index={currentTab}>
|
2023-09-28 11:45:50 +01:00
|
|
|
<Courses courses={$courses} />
|
2023-08-15 14:28:51 +00:00
|
|
|
</TabContent>
|
|
|
|
|
<TabContent value={tabs[1].value} index={currentTab}>
|
2023-09-29 09:25:32 +01:00
|
|
|
<Courses courses={[]} />
|
2023-08-15 14:28:51 +00:00
|
|
|
</TabContent>
|
|
|
|
|
</slot:fragment>
|
|
|
|
|
</Tabs>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|