+
+
+
## Key Features:
- 📚 **Browse & Filter Courses**
- 💳 **Purchase Courses with Stripe**
diff --git a/actions/getCourses.ts b/actions/getCourses.ts
new file mode 100644
index 00000000..03a289ba
--- /dev/null
+++ b/actions/getCourses.ts
@@ -0,0 +1,73 @@
+import { db } from "@/lib/db";
+import { Category, Course } from "@prisma/client";
+import { getProgress } from "./getProgress";
+
+type CourseWithProgressWithCategory = Course & {
+ category: Category | null;
+ chapters: { id: string }[];
+ progress: number | null;
+};
+
+type GetCourses = {
+ userId: string;
+ title?: string;
+ categoryId?: string;
+};
+
+export const getCourses = async ({
+ userId,
+ title,
+ categoryId,
+}: GetCourses): Promise+ {initialData.isFree ? <>This chapter is free for preview> : <>This chapter is not free>} +
+ )} + {isEditing && ( + + + )} +{initialData.title}
} + {isEditing && ( + + + )} ++ {attachment.name} +
+ {deletingId === attachment.id && ( ++ {selectedOption?.label || 'No Category'} +
+ )} + + {isEditing && ( + + + )} ++ Drag and drop to reorder the chapters +
+ )} ++ {initialData.description || 'No description'} +
+ )} + {isEditing && ( + + + )} ++ {initialData.price ? formatPrice(initialData.price) : 'No Price'} +
+ )} + {isEditing && ( + + + )} ++ {initialData.title} +
+ ) + + } + {isEditing && ( + + + )} +TODO: Chapters
++ What would you like to name your course? Don't worry, you can change it later. +
+ +Page
- - -{category}
+{formatPrice(price)}
+ )} ++ {body} +
+ ) +}) +FormMessage.displayName = "FormMessage" + +export { + useFormField, + Form, + FormItem, + FormLabel, + FormControl, + FormDescription, + FormMessage, + FormField, +} diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx new file mode 100644 index 00000000..68551b92 --- /dev/null +++ b/src/components/ui/input.tsx @@ -0,0 +1,22 @@ +import * as React from "react" + +import { cn } from "@/lib/utils" + +const Input = React.forwardRef