diff --git a/apps/nextjs/src/components/AppComponents/Chat/Chat/hooks/useProgressForDownloads.ts b/apps/nextjs/src/components/AppComponents/Chat/Chat/hooks/useProgressForDownloads.ts index 145ff171e..4f3786afd 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/Chat/hooks/useProgressForDownloads.ts +++ b/apps/nextjs/src/components/AppComponents/Chat/Chat/hooks/useProgressForDownloads.ts @@ -1,9 +1,26 @@ import { useMemo } from "react"; -import type { LooseLessonPlan } from "@oakai/aila/src/protocol/schema"; +import type { + LessonPlanKeys, + LooseLessonPlan, +} from "@oakai/aila/src/protocol/schema"; import { lessonPlanSectionsSchema } from "@oakai/exports/src/schema/input.schema"; import type { ZodIssue } from "zod"; +export type ProgressForDownloads = { + sections: ProgressSection[]; + totalSections: number; + totalSectionsComplete: number; +}; + +export type ProgressSection = { + label: string; + key: LessonPlanKeys; + complete: boolean; +}; + +export type ProgressSections = ProgressSection[]; + /** * For a given list of Zod issues and lessonPlan fields, checks that none of * the errors pertain to the fields. @@ -16,16 +33,6 @@ function getCompleteness(errors: ZodIssue[], fields: string[]) { return !hasErrorInSomeField; } -export type ProgressSections = { - label: string; - key: string; - complete: boolean; -}[]; -type ProgressForDownloads = { - sections: ProgressSections; - totalSections: number; - totalSectionsComplete: number; -}; export function useProgressForDownloads({ lessonPlan, @@ -60,7 +67,8 @@ export function useProgressForDownloads({ return true; } }) ?? []; - const sections = [ + + const sections: ProgressSection[] = [ { label: "Lesson details", key: "title",