"use client"

import { ExamViewer } from "@/modules/exams/components/exam-viewer"
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
}) {
  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">Question Preview</span>
      </div>
      <ScrollArea className="flex-1 bg-background">
        <div className="p-6">
          <ExamViewer
            structure={structure}
            questions={questions}
            selectedQuestionId={selectedQuestionId}
            onQuestionSelect={onQuestionSelect}
          />
        </div>
      </ScrollArea>
    </div>
  )
}
