diff --git a/src/components/ai/IntelligentProgress.tsx b/src/components/ai/IntelligentProgress.tsx new file mode 100644 index 00000000..5466c826 --- /dev/null +++ b/src/components/ai/IntelligentProgress.tsx @@ -0,0 +1,100 @@ +'use client'; + +import { useState, useEffect } from 'react'; +import { TrendingUp } from 'lucide-react'; +import { apiClient } from '@/lib/api'; + +// GET /api/ai/progress β { courses: CourseProgress[]; insights: string[] } + +interface CourseProgress { + id: string; + title: string; + percent: number; +} + +interface ProgressData { + courses: CourseProgress[]; + insights: string[]; +} + +function ProgressBar({ percent }: { percent: number }) { + const clamped = Math.min(100, Math.max(0, percent)); + return ( +
Failed to load progress.
+ )} + + {data && ( + <> ++ π‘ {insight} +
+ ))} ++ Ask me anything about your courses! +
+ )} + + {messages.map((msg) => ( +Search failed. Please try again.
+ )} + + {results !== null && results.length === 0 && ( +No results found.
+ )} + + {results?.map((item) => ( + + ))} ++ Failed to load recommendations. +
+ )} + + {!loading && !error && items.length === 0 && ( +No recommendations yet.
+ )} + + {items.map((item) => ( + + ))} +No upcoming reminders.
+ )} + + {reminders.map((reminder) => ( ++ {reminder.title} +
++ {new Date(reminder.scheduledAt).toLocaleString()} +
++ {date} +
+ {items.map((activity) => ( ++ {activity.actorName}{' '} + {activity.action} + {activity.targetTitle && ( + <> {activity.targetTitle}> + )} +
++ {getRelativeTime(activity.createdAt)} +
+No more activity
+ )} + + {!loading && activities.length === 0 && ( +No activity yet.
+ )} +{user.name}
+ {user.bio && ( ++ {user.bio} +
+ )} +No users found.
+ )} + {!loading && filtered.map((u) =>{c.authorName}
+{c.body}
+{getRelativeTime(c.createdAt)}
+No comments yet.
+ )} +{user.bio}
+ )} + +Posts will appear here.
} + {activeTab === 'activity' &&Recent activity will appear here.
} + {activeTab === 'analytics' &&Analytics will appear here.
} +