'use client'
/**
* Top navigation bar for the Korrektur-Workspace.
* Shows back link, student navigation, workflow status, and grade.
*/
import Link from 'next/link'
import type { ExaminerWorkflow } from './workspace-types'
import { WORKFLOW_STATUS_LABELS, ROLE_LABELS, GRADE_LABELS } from './workspace-types'
interface WorkspaceTopBarProps {
klausurId: string
backPath: string
currentIndex: number
studentCount: number
workflow: ExaminerWorkflow | null
saving: boolean
totals: { gradePoints: number; weighted: number }
onGoToStudent: (direction: 'prev' | 'next') => void
}
export default function WorkspaceTopBar({
klausurId, backPath, currentIndex, studentCount,
workflow, saving, totals, onGoToStudent,
}: WorkspaceTopBarProps) {
return (
{/* Back link */}
Zurueck
{/* Student navigation */}
{currentIndex + 1} / {studentCount}
{/* Workflow status and role */}
{workflow && (
{ROLE_LABELS[workflow.user_role]?.label || workflow.user_role}
{WORKFLOW_STATUS_LABELS[workflow.workflow_status]?.label || workflow.workflow_status}
{workflow.user_role === 'zk' && workflow.visibility_mode !== 'full' && (
{workflow.visibility_mode === 'blind' ? 'Blind-Modus' : 'Semi-Blind'}
)}
)}
{saving && (
Speichern...
)}
{totals.gradePoints} Punkte
Note: {GRADE_LABELS[totals.gradePoints] || '-'}
)
}