'use client' /** * Right panel (1/3 width) for the Korrektur-Workspace. * Contains tabs: Kriterien, Annotationen, Gutachten, EH-Vorschlaege. */ import type { Annotation, CriteriaScores, GradeInfo, AnnotationType, } from '../../app/admin/klausur-korrektur/types' import { ANNOTATION_COLORS } from '../../app/admin/klausur-korrektur/types' import type { ExaminerWorkflow, ActiveTab } from './workspace-types' import { GRADE_LABELS } from './workspace-types' import CriteriaTab from './CriteriaTab' import WorkflowActions from './WorkflowActions' interface CorrectionPanelProps { activeTab: ActiveTab onTabChange: (tab: ActiveTab) => void annotations: Annotation[] gradeInfo: GradeInfo | null criteriaScores: CriteriaScores gutachten: string totals: { gradePoints: number; weighted: number } workflow: ExaminerWorkflow | null saving: boolean generatingGutachten: boolean exporting: boolean submittingWorkflow: boolean selectedAnnotation: Annotation | null studentId: string klausurId: string klausurEhId?: string onCriteriaChange: (criterion: string, value: number) => void onGutachtenChange: (text: string) => void onSaveGutachten: () => void onGenerateGutachten: () => void onExportGutachtenPDF: () => void onSelectAnnotation: (ann: Annotation | null) => void onUpdateAnnotation: (id: string, updates: Partial) => void onDeleteAnnotation: (id: string) => void onSelectTool: (tool: AnnotationType) => void onSetActiveTab: (tab: ActiveTab) => void onSubmitErstkorrektur: () => void onStartZweitkorrektur: (id: string) => void onSubmitZweitkorrektur: () => void onShowEinigungModal: () => void // Render props for route-specific components AnnotationPanelComponent: React.ComponentType<{ annotations: Annotation[] selectedAnnotation: Annotation | null onSelectAnnotation: (ann: Annotation | null) => void onUpdateAnnotation: (id: string, updates: Partial) => void onDeleteAnnotation: (id: string) => void }> EHSuggestionPanelComponent: React.ComponentType<{ studentId: string klausurId: string hasEH: boolean apiBase: string onInsertSuggestion: (text: string, criterion: string) => void }> } export default function CorrectionPanel(props: CorrectionPanelProps) { const { activeTab, onTabChange, annotations, gradeInfo, criteriaScores, gutachten, totals, workflow, saving, generatingGutachten, exporting, submittingWorkflow, selectedAnnotation, studentId, klausurId, klausurEhId, onCriteriaChange, onGutachtenChange, onSaveGutachten, onGenerateGutachten, onExportGutachtenPDF, onSelectAnnotation, onUpdateAnnotation, onDeleteAnnotation, onSelectTool, onSetActiveTab, onSubmitErstkorrektur, onStartZweitkorrektur, onSubmitZweitkorrektur, onShowEinigungModal, AnnotationPanelComponent, EHSuggestionPanelComponent, } = props const apiBase = process.env.NEXT_PUBLIC_KLAUSUR_SERVICE_URL || 'http://localhost:8086' return (
{/* Tabs */}
{/* Tab content */}
{/* Kriterien Tab */} {activeTab === 'kriterien' && gradeInfo && (
{/* Total and workflow actions */}
Gesamtergebnis
{totals.gradePoints} Punkte
({totals.weighted}%) - Note {GRADE_LABELS[totals.gradePoints]}
)} {/* Annotationen Tab */} {activeTab === 'annotationen' && (
)} {/* Gutachten Tab */} {activeTab === 'gutachten' && (