'use client' /** * Criteria scoring tab content. * Shows sliders and annotation counts for each grading criterion. */ import type { Annotation, GradeInfo, CriteriaScores, AnnotationType } from '../../app/admin/klausur-korrektur/types' import { ANNOTATION_COLORS } from '../../app/admin/klausur-korrektur/types' interface CriteriaTabProps { gradeInfo: GradeInfo criteriaScores: CriteriaScores annotations: Annotation[] onCriteriaChange: (criterion: string, value: number) => void onSelectTool: (tool: AnnotationType) => void } export default function CriteriaTab({ gradeInfo, criteriaScores, annotations, onCriteriaChange, onSelectTool, }: CriteriaTabProps) { return ( <> {Object.entries(gradeInfo.criteria || {}).map(([key, criterion]) => { const score = criteriaScores[key] || 0 const linkedAnnotations = annotations.filter( (a) => a.linked_criterion === key || a.type === key ) const errorCount = linkedAnnotations.length const severityCounts = { minor: linkedAnnotations.filter((a) => a.severity === 'minor').length, major: linkedAnnotations.filter((a) => a.severity === 'major').length, critical: linkedAnnotations.filter((a) => a.severity === 'critical').length, } const criterionColor = ANNOTATION_COLORS[key as AnnotationType] || '#6b7280' return (