"use client"

import { ExamViewer } from "@/modules/exams/components/exam-viewer"
import { useTranslations } from "next-intl"
import { ScrollArea } from "@/shared/components/ui/scroll-area"

export function HomeworkAssignmentExamPreviewPane({
  structure,
  questions,
  selectedQuestionId,
  onQuestionSelect,
}: {
  structure: unknown
  questions: Array<{
    questionId: string
    questionType: string
    questionContent: unknown
    maxScore: number
  }>
  selectedQuestionId: string | null
  onQuestionSelect: (questionId: string) => void
}) {
  const t = useTranslations("examHomework")
  return (
    <div className="md:col-span-2 flex h-full flex-col overflow-hidden">
      <div className="border-b px-6 py-4 bg-muted/5 flex items-center justify-between">
        <span className="text-sm font-medium">{t("homework.analytics.questionPreview")}</span>
      </div>
      <ScrollArea className="flex-1 bg-background">
        <div className="p-6">
          <ExamViewer
            structure={structure}
            questions={questions}
            selectedQuestionId={selectedQuestionId}
            onQuestionSelect={onQuestionSelect}
          />
        </div>
      </ScrollArea>
    </div>
  )
}
