"use client"; import { useTranslation } from "react-i18next"; import type { GuardianReadingSummary } from "@/lib/guardian-api"; export function GuardianReadingReport({ reading }: { reading: GuardianReadingSummary }) { const { t, i18n } = useTranslation(); const helpEvents = reading.help_events ?? []; const titles = new Map(reading.quizzes.map(item => [item.material_id, item.material_title])); return (

{t("Reading progress and quiz records")}

{t("Reading position and quiz results do not establish independent mastery.")}

{reading.reading_status === "available" ? <>

{t("Showing {{shown}} of {{total}} reading records", { shown: reading.progress.length, total: reading.progress_total })}

{t("Recent reading activities: {{count}} (up to {{limit}})", { count: reading.activities.length, limit: reading.limit })}

:

{reading.reading_status === "migration_required" ? t("Reading records need migration before they can be reported. Viewing this report does not migrate them.") : t("Reading records have not been initialized.")}

} {reading.quiz_status === "available" ? <>

{t("Showing {{shown}} of {{total}} quiz records", { shown: reading.quizzes.length, total: reading.quiz_total })}

:

{reading.quiz_status === "migration_required" ? t("Quiz records need migration before they can be reported. Viewing this report does not migrate them.") : t("Quiz records have not been initialized.")}

}

{t("Question-linked help history")}

{t("Help may occur before or after an answer; it does not change earlier attempt records.")}

{reading.help_status === "available" ? <>

{t("Showing {{shown}} of {{total}} help records", { shown: helpEvents.length, total: reading.help_total ?? 0 })}

:

{t("Question-linked help history is unavailable in this version.")}

}
); }