From 6d4717127a32d76065b229264495baba60cf4763 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Sat, 8 Mar 2025 15:39:59 +0000 Subject: [PATCH] Course content responsiveness --- .../GenerateCourse/AICourseContent.tsx | 42 +++++++++++-------- .../AICourseFollowUpPopover.tsx | 5 ++- .../GenerateCourse/AICourseLimit.tsx | 28 ++++++------- src/helper/number.ts | 10 ++--- 4 files changed, 47 insertions(+), 38 deletions(-) diff --git a/src/components/GenerateCourse/AICourseContent.tsx b/src/components/GenerateCourse/AICourseContent.tsx index 4802fc73d..9cf95893a 100644 --- a/src/components/GenerateCourse/AICourseContent.tsx +++ b/src/components/GenerateCourse/AICourseContent.tsx @@ -122,27 +122,33 @@ export function AICourseContent(props: AICourseContentProps) { aria-label="Back to generator" > - Back to Generator + Back to Generator - +
+
+ +
+ + +
-
+
-

+

{course.title || 'Loading Course...'}

-
+
{totalModules} modules {totalCourseLessons} lessons @@ -157,8 +163,10 @@ export function AICourseContent(props: AICourseContentProps) {
-
- +
+
+ +
{viewMode === 'module' && ( + +
+ {userBillingDetails.status === 'none' && ( <> diff --git a/src/helper/number.ts b/src/helper/number.ts index f62d25dd3..5e1309319 100644 --- a/src/helper/number.ts +++ b/src/helper/number.ts @@ -1,12 +1,12 @@ -export function getPercentage(portion: number, total: number): string { +export function getPercentage(portion: number, total: number): number { if (portion <= 0 || total <= 0) { - return '0.00'; + return 0; } - + if (portion >= total) { - return '100.00'; + return 100; } const percentage = (portion / total) * 100; - return percentage.toFixed(2); + return Math.round(percentage); }