diff --git a/src/components/CourseCard.tsx b/src/components/CourseCard.tsx index 3abebda30..ac4ca8fe8 100644 --- a/src/components/CourseCard.tsx +++ b/src/components/CourseCard.tsx @@ -1,9 +1,11 @@ 'use client'; import { Course } from '@/store/atoms'; -import PercentageComplete from './PercentageComplete'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { Button } from './ui/button'; +import { Card, CardContent } from "@/components/ui/card"; +import { motion } from "framer-motion"; +import { MessageCircle, PlayCircle } from "lucide-react"; export const CourseCard = ({ course, @@ -14,54 +16,63 @@ export const CourseCard = ({ }) => { const router = useRouter(); const imageUrl = course.imageUrl ? course.imageUrl : 'banner_placeholder.png'; + const percentage = course.totalVideos !== undefined ? Math.ceil(((course.totalVideosWatched ?? 0) / course?.totalVideos) * 100) : 0; + return ( -
-
+ +
{course.title} - {course.totalVideos !== undefined && ( - <> - - - )} -
-
-
-

- {course.title} -

- {course.totalVideos !== undefined && ( - <> - - {Math.ceil( - ((course.totalVideosWatched ?? 0) / course.totalVideos) * 100, - )} - % - - - )} +
+
+
+
+ + + + +
+ {percentage}% +
+
+
+
-
-
+ +

+ {course.title} +

+
+ - {course.certIssued ? ( ) : ( + Join Discord )}
-
-
+ + ); }; diff --git a/src/components/Courses.tsx b/src/components/Courses.tsx index 6e2befd28..416fae1cd 100644 --- a/src/components/Courses.tsx +++ b/src/components/Courses.tsx @@ -41,7 +41,7 @@ export const Courses = ({ courses }: { courses: Course[] }) => { /> ))}