"use client"; import { useState } from "react"; import { Button } from "@/components/ui"; import { AskButton } from "@/components/chat/AskButton"; import { useI18n } from "@/lib/i18n"; import type { HomeworkMakeRecord } from "@/lib/schemas"; import { shareHomework } from "@/lib/share"; import { ReportQuestionButton } from "@/components/ReportQuestionButton"; import { homeworkReportActivity } from "@/lib/question-reports"; import { CopyButton } from "./CopyButton"; import { FollowUpBar } from "./FollowUpBar"; /** Mode 1 result: the finished homework, nothing else. */ export function HomeworkResult({ record, onAgain, onNew, onToDeck, againLoading, }: { record: HomeworkMakeRecord; onAgain: () => void; onNew: () => void; onToDeck: () => void; againLoading: boolean; }) { const { t } = useI18n(); const [answer, setAnswer] = useState(record.answer); return (

{t("homework.result.title")}

{record.title}

{answer}

setAnswer(record.answer)} canRestore={answer !== record.answer} />

{t("homework.toDeckNote")}

{/* Same report control as the study feeds and the guide, under the result (the homework record is the "deck" here). */}
); }