+ {showActions && course.slug && (
+
)}
diff --git a/src/pages/ai/courses.astro b/src/pages/ai/courses.astro
new file mode 100644
index 000000000..e54254731
--- /dev/null
+++ b/src/pages/ai/courses.astro
@@ -0,0 +1,21 @@
+---
+import { UserCoursesList } from '../../components/GenerateCourse/UserCoursesList';
+import SkeletonLayout from '../../layouts/SkeletonLayout.astro';
+import { AITutorLayout } from '../../components/AITutor/AITutorLayout';
+const ogImage = 'https://roadmap.sh/og-images/ai-tutor.png';
+---
+
+
+
+
+
+
diff --git a/src/pages/ai/explore.astro b/src/pages/ai/explore.astro
new file mode 100644
index 000000000..60f0e352a
--- /dev/null
+++ b/src/pages/ai/explore.astro
@@ -0,0 +1,21 @@
+---
+import { AIExploreCourseListing } from '../../components/AITutor/AIExploreCourseListing';
+import SkeletonLayout from '../../layouts/SkeletonLayout.astro';
+import { AITutorLayout } from '../../components/AITutor/AITutorLayout';
+const ogImage = 'https://roadmap.sh/og-images/ai-tutor.png';
+---
+
+
+
+
+
+
diff --git a/src/pages/ai/index.astro b/src/pages/ai/index.astro
index c0e6a1f6f..16db0eceb 100644
--- a/src/pages/ai/index.astro
+++ b/src/pages/ai/index.astro
@@ -3,7 +3,7 @@ import { ChevronLeft, PlusCircle, BookOpen, Compass } from 'lucide-react';
import { CheckSubscriptionVerification } from '../../components/Billing/CheckSubscriptionVerification';
import { AICourse } from '../../components/GenerateCourse/AICourse';
import SkeletonLayout from '../../layouts/SkeletonLayout.astro';
-import { AITutorSidebar } from '../../components/AITutor/AITutorSidebar';
+import { AITutorLayout } from '../../components/AITutor/AITutorLayout';
const ogImage = 'https://roadmap.sh/og-images/ai-tutor.png';
---
@@ -13,11 +13,8 @@ const ogImage = 'https://roadmap.sh/og-images/ai-tutor.png';
ogImageUrl={ogImage}
description='Learn anything with AI Tutor. Pick a topic, choose a difficulty level and the AI will guide you through the learning process.'
>
-
+
+
+
+
diff --git a/src/pages/ai/stuff-picks.astro b/src/pages/ai/stuff-picks.astro
new file mode 100644
index 000000000..ad7ad5f74
--- /dev/null
+++ b/src/pages/ai/stuff-picks.astro
@@ -0,0 +1,21 @@
+---
+import { AIFeaturedCoursesListing } from '../../components/AITutor/AIFeaturedCoursesListing';
+import SkeletonLayout from '../../layouts/SkeletonLayout.astro';
+import { AITutorLayout } from '../../components/AITutor/AITutorLayout';
+const ogImage = 'https://roadmap.sh/og-images/ai-tutor.png';
+---
+
+
+
+
+
+
diff --git a/src/queries/ai-course.ts b/src/queries/ai-course.ts
index 0a955bb12..0ab1a601c 100644
--- a/src/queries/ai-course.ts
+++ b/src/queries/ai-course.ts
@@ -1,6 +1,7 @@
import { httpGet } from '../lib/query-http';
import { isLoggedIn } from '../lib/jwt';
-import { queryOptions } from '@tanstack/react-query';
+import { queryOptions, useInfiniteQuery } from '@tanstack/react-query';
+import { queryClient } from '../stores/query-client';
export interface AICourseProgressDocument {
_id: string;
@@ -99,3 +100,48 @@ export function listUserAiCoursesOptions(
enabled: !!isLoggedIn(),
};
}
+
+type ListExploreAiCoursesParams = {};
+
+type ListExploreAiCoursesQuery = {
+ perPage?: string;
+ currPage?: string;
+};
+
+type ListExploreAiCoursesResponse = {
+ data: AICourseWithLessonCount[];
+ currPage: number;
+ perPage: number;
+};
+
+export function useListExploreAiCourses() {
+ return useInfiniteQuery(
+ {
+ queryKey: ['explore-ai-courses'],
+ queryFn: ({ pageParam = 1 }) => {
+ return httpGet
(
+ `/v1-list-explore-ai-courses`,
+ {
+ perPage: '20',
+ currPage: String(pageParam),
+ },
+ );
+ },
+ getNextPageParam: (lastPage, pages, lastPageParam) => {
+ if (lastPage?.data?.length === 0) {
+ return undefined;
+ }
+
+ return lastPageParam + 1;
+ },
+ getPreviousPageParam: (firstPage, allPages, firstPageParam) => {
+ if (firstPageParam <= 1) {
+ return undefined;
+ }
+ return firstPageParam - 1;
+ },
+ initialPageParam: 1,
+ },
+ queryClient,
+ );
+}