diff --git a/src/components/AIGuide/AILibraryLayout.tsx b/src/components/AIGuide/AILibraryLayout.tsx
index fb2173aac..8e8e50ed1 100644
--- a/src/components/AIGuide/AILibraryLayout.tsx
+++ b/src/components/AIGuide/AILibraryLayout.tsx
@@ -5,7 +5,7 @@ import { UpgradeAccountModal } from '../Billing/UpgradeAccountModal';
import { LibraryTabs } from '../Library/LibraryTab';
type AILibraryLayoutProps = {
- activeTab: 'courses' | 'guides';
+ activeTab: 'courses' | 'guides' | 'roadmaps';
children: React.ReactNode;
};
@@ -22,7 +22,7 @@ export function AILibraryLayout(props: AILibraryLayoutProps) {
-
-
setShowUpgradeModal(true)}
- onShowLimits={() => setShowAILimitsPopup(true)}
- />
+ {!isLoading && (
+
+
+
setShowUpgradeModal(true)}
+ onShowLimits={() => setShowAILimitsPopup(true)}
+ />
+
-
+ )}
diff --git a/src/components/Library/LibraryTab.tsx b/src/components/Library/LibraryTab.tsx
index 18d3c445f..ceb0aa06b 100644
--- a/src/components/Library/LibraryTab.tsx
+++ b/src/components/Library/LibraryTab.tsx
@@ -1,8 +1,8 @@
-import { BookOpen, FileTextIcon, type LucideIcon } from 'lucide-react';
+import { BookOpen, FileTextIcon, MapIcon, type LucideIcon } from 'lucide-react';
import { cn } from '../../lib/classname';
type LibraryTabsProps = {
- activeTab: 'guides' | 'courses';
+ activeTab: 'guides' | 'courses' | 'roadmaps';
};
export function LibraryTabs(props: LibraryTabsProps) {
@@ -22,6 +22,12 @@ export function LibraryTabs(props: LibraryTabsProps) {
label="Guides"
href="/ai/guides"
/>
+
);
}
diff --git a/src/pages/ai/roadmaps.astro b/src/pages/ai/roadmaps.astro
new file mode 100644
index 000000000..0c17ac982
--- /dev/null
+++ b/src/pages/ai/roadmaps.astro
@@ -0,0 +1,17 @@
+---
+import { UserRoadmapsList } from '../../components/AIRoadmap/UserRoadmapsList';
+import SkeletonLayout from '../../layouts/SkeletonLayout.astro';
+import { AILibraryLayout } from '../../components/AIGuide/AILibraryLayout';
+const ogImage = 'https://roadmap.sh/og-images/ai-tutor.png';
+---
+
+
+
+
+
+
diff --git a/src/queries/ai-roadmap.ts b/src/queries/ai-roadmap.ts
index ce4f7725c..200d1e759 100644
--- a/src/queries/ai-roadmap.ts
+++ b/src/queries/ai-roadmap.ts
@@ -51,6 +51,8 @@ import { queryClient } from '../stores/query-client';
import { getAiCourseLimitOptions } from '../queries/ai-course';
import { readChatStream } from '../lib/chat';
import type { QuestionAnswerChatMessage } from '../components/ContentGenerator/QuestionAnswerChat';
+import type { AIGuideDocument } from './ai-guide';
+import { isLoggedIn } from '../lib/jwt';
type RoadmapDetails = {
roadmapId: string;
@@ -176,3 +178,36 @@ export async function generateAIRoadmap(options: GenerateAIRoadmapOptions) {
onStreamingChange?.(false);
}
}
+
+export type ListUserAiRoadmapsQuery = {
+ perPage?: string;
+ currPage?: string;
+ query?: string;
+};
+
+export type ListUserAiRoadmapsResponse = {
+ data: Omit
[];
+ totalCount: number;
+ totalPages: number;
+ currPage: number;
+ perPage: number;
+};
+
+export function listUserAiRoadmapsOptions(
+ params: ListUserAiRoadmapsQuery = {
+ perPage: '21',
+ currPage: '1',
+ query: '',
+ },
+) {
+ return queryOptions({
+ queryKey: ['user-ai-roadmaps', params],
+ queryFn: () => {
+ return httpGet(
+ `/v1-list-user-ai-roadmaps`,
+ params,
+ );
+ },
+ enabled: !!isLoggedIn(),
+ });
+}