import { apiGet } from "@/lib/api/client"; export type DashboardMaterials = { total: number; ready: number; processing: number; needs_review: number; }; export type DashboardSource = { id: string; title: string; subject: string; status: "ready"; material_type?: string | null; source_type?: string | null; }; export type DashboardResult = { id: string; label: string; source_title: string; created_at: string | null; }; export type DashboardStudyFocus = { exam: string | null; subject: string | null; time_left: string | null; goal: string | null; weak_areas: string[]; }; export type DashboardVideoLessons = { total: number; ready: number; in_progress: number; }; export type DashboardRecommendedAction = { kind: "upload" | "wait" | "revise" | "generate" | "practice"; label: string; }; export type StudentDashboard = { materials: DashboardMaterials; recent_source: DashboardSource | null; recent_results: DashboardResult[]; study_focus: DashboardStudyFocus; video_lessons: DashboardVideoLessons; recommended_action: DashboardRecommendedAction; }; /** Fetch the aggregated student dashboard snapshot. User-scoped. */ export async function getStudentDashboard(options?: { signal?: AbortSignal; }): Promise { return apiGet("/dashboard/student", { signal: options?.signal, timeoutMs: 15000, }); }