feat: Implement user dashboard with recommended courses, a 'My Courses' page for enrolled courses, and a reusable CourseCard component.
This commit is contained in:
parent
840eae4fad
commit
acff387a9b
4 changed files with 9 additions and 8 deletions
|
|
@ -41,9 +41,9 @@ onMounted(async () => {
|
|||
if (res.success && res.data?.length) {
|
||||
recommendedCourses.value = res.data.map((c: any) => ({
|
||||
id: c.id,
|
||||
title: getLocalizedText(c.title),
|
||||
category: getLocalizedText(catMap.get(c.category_id)) || 'General',
|
||||
duration: c.lessons ? `${c.lessons} ${t('course.lessonsUnit')}` : '',
|
||||
title: c.title,
|
||||
category: catMap.get(c.category_id),
|
||||
lessons: c.lessons,
|
||||
image: c.thumbnail_url || '',
|
||||
badge: '',
|
||||
badgeType: ''
|
||||
|
|
@ -55,7 +55,7 @@ onMounted(async () => {
|
|||
<template>
|
||||
<div class="page-container">
|
||||
<!-- Welcome Header Section -->
|
||||
<div class="welcome-section mb-10 overflow-hidden relative rounded-[2.5rem] p-8 md:p-12 text-white shadow-xl dark:shadow-2xl dark:shadow-blue-950/40 transition-all border border-white/5">
|
||||
<div class="welcome-section mb-10 overflow-hidden relative rounded-[2.5rem] p-8 md:p-12 text-white shadow-xl dark:shadow-2xl dark:shadow-blue-950/40 transition border border-white/5">
|
||||
<div class="relative z-10 flex flex-col md:flex-row justify-between items-center gap-8">
|
||||
<div class="text-center md:text-left">
|
||||
<ClientOnly>
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ const loadEnrolledCourses = async () => {
|
|||
enrolledCourses.value = courses.map(item => ({
|
||||
id: item.course_id,
|
||||
enrollment_id: item.id,
|
||||
title: getLocalizedText(item.course.title),
|
||||
title: item.course.title,
|
||||
progress: item.progress_percentage || 0,
|
||||
completed: item.status === 'COMPLETED',
|
||||
thumbnail_url: item.course.thumbnail_url
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue