feat/course
Arik Chakma 4 days ago
parent 7e4e2b4b62
commit ddb8ceda0a
  1. 11
      src/api/course.ts
  2. 19
      src/components/CourseLanding/CourseLanding.tsx

@ -12,19 +12,18 @@ export type AllowedCourseDifficulty =
export interface CourseDocument { export interface CourseDocument {
_id: string; _id: string;
title: string;
slug: string; slug: string;
title: string;
description?: string; description?: string;
difficulty?: AllowedCourseDifficulty; detailedDescription?: string;
briefTitle?: string;
briefDescription?: string;
creatorId: string; difficulty?: AllowedCourseDifficulty;
willLearn?: string[]; willLearn?: string[];
prerequisites?: string[]; prerequisites?: string[];
creatorId: string;
// AI Configurations // AI Configurations
setting: { setting: {
prompt?: string; prompt?: string;

@ -47,8 +47,7 @@ export function CourseLanding(props: CourseLandingProps) {
title, title,
chapters, chapters,
description, description,
briefDescription, detailedDescription,
briefTitle,
difficulty, difficulty,
updatedAt, updatedAt,
rating, rating,
@ -89,7 +88,7 @@ export function CourseLanding(props: CourseLandingProps) {
<a href={`/learn/${course.slug}`}>{title}</a> <a href={`/learn/${course.slug}`}>{title}</a>
</p> </p>
<h1 className="mt-8 text-5xl font-bold">{briefTitle}</h1> <h1 className="mt-8 text-5xl font-bold">{title}</h1>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<CourseStatPill <CourseStatPill
@ -104,17 +103,13 @@ export function CourseLanding(props: CourseLandingProps) {
/> />
</div> </div>
{briefDescription && ( {description && (
<Description <Description description={description} className="prose-invert" />
description={briefDescription}
className="prose-invert"
/>
)} )}
<div className="flex items-center gap-2 text-sm"> <div className="flex items-center gap-2 text-sm">
<span>{averageRating}</span>
<Rating rating={averageRating} /> <Rating rating={averageRating} />
<span>({rating.count} ratings)</span> <span>{averageRating}</span>
</div> </div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
@ -148,10 +143,10 @@ export function CourseLanding(props: CourseLandingProps) {
</CourseInfoCard> </CourseInfoCard>
)} )}
{description && ( {detailedDescription && (
<CourseInfoCard title="About this Course"> <CourseInfoCard title="About this Course">
<div className="mt-4"> <div className="mt-4">
<Description description={description} /> <Description description={detailedDescription} />
</div> </div>
</CourseInfoCard> </CourseInfoCard>
)} )}

Loading…
Cancel
Save