import type { HomeworkAssignmentQuestionAnalytics } from "@/modules/homework/types"
import { useTranslations } from "next-intl"

import { Card, CardContent, CardHeader, CardTitle } from "@/shared/components/ui/card"
import { HomeworkAssignmentExamErrorExplorerLazy } from "@/modules/homework/components/homework-assignment-exam-error-explorer-lazy"

export function HomeworkAssignmentExamContentCard({
  structure,
  questions,
  gradedSampleCount,
}: {
  structure: unknown
  questions: HomeworkAssignmentQuestionAnalytics[]
  gradedSampleCount: number
}) {
  const t = useTranslations("examHomework")
  return (
    <Card>
      <CardHeader className="pb-3">
        <CardTitle className="text-sm font-medium text-muted-foreground">{t("homework.analytics.examContent")}</CardTitle>
      </CardHeader>
      <CardContent className="p-0">
        <HomeworkAssignmentExamErrorExplorerLazy
          structure={structure}
          questions={questions}
          gradedSampleCount={gradedSampleCount}
        />
      </CardContent>
    </Card>
  )
}
