2023-09-15 08:26:26 +01:00
|
|
|
<script lang="ts">
|
2023-08-02 19:35:27 +01:00
|
|
|
import CourseLandingPage from '$lib/components/CourseLandingPage/index.svelte';
|
2023-09-15 08:26:26 +01:00
|
|
|
import type { Course } from '$lib/utils/types';
|
2023-08-02 19:35:27 +01:00
|
|
|
|
2023-09-15 08:26:26 +01:00
|
|
|
interface Data {
|
|
|
|
|
course: Course;
|
|
|
|
|
}
|
2023-09-24 13:20:04 +00:00
|
|
|
|
2023-09-15 08:26:26 +01:00
|
|
|
export let data: Data;
|
2023-08-02 19:35:27 +01:00
|
|
|
|
2023-09-15 08:26:26 +01:00
|
|
|
let courseData: Course;
|
2023-08-02 19:35:27 +01:00
|
|
|
|
2023-09-15 08:26:26 +01:00
|
|
|
function setCourseData(course: Course | null) {
|
|
|
|
|
if (!course) return;
|
|
|
|
|
|
|
|
|
|
courseData = { ...course };
|
2023-08-02 19:35:27 +01:00
|
|
|
}
|
|
|
|
|
|
2023-09-15 08:26:26 +01:00
|
|
|
$: setCourseData(data.course);
|
2023-08-02 19:35:27 +01:00
|
|
|
</script>
|
|
|
|
|
|
2023-09-15 08:26:26 +01:00
|
|
|
<CourseLandingPage {courseData} />
|