backend-lehrer (5 files): - alerts_agent/db/repository.py (992 → 5), abitur_docs_api.py (956 → 3) - teacher_dashboard_api.py (951 → 3), services/pdf_service.py (916 → 3) - mail/mail_db.py (987 → 6) klausur-service (5 files): - legal_templates_ingestion.py (942 → 3), ocr_pipeline_postprocess.py (929 → 4) - ocr_pipeline_words.py (876 → 3), ocr_pipeline_ocr_merge.py (616 → 2) - KorrekturPage.tsx (956 → 6) website (5 pages): - mail (985 → 9), edu-search (958 → 8), mac-mini (950 → 7) - ocr-labeling (946 → 7), audit-workspace (871 → 4) studio-v2 (5 files + 1 deleted): - page.tsx (946 → 5), MessagesContext.tsx (925 → 4) - korrektur (914 → 6), worksheet-cleanup (899 → 6) - useVocabWorksheet.ts (888 → 3) - Deleted dead page-original.tsx (934 LOC) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
61 lines
2.1 KiB
TypeScript
61 lines
2.1 KiB
TypeScript
'use client'
|
|
|
|
import type { Klausur } from '../types'
|
|
import { GlassCard } from './GlassCard'
|
|
|
|
interface KlausurCardProps {
|
|
klausur: Klausur
|
|
onClick: () => void
|
|
delay?: number
|
|
isDark?: boolean
|
|
}
|
|
|
|
export function KlausurCard({ klausur, onClick, delay = 0, isDark = true }: KlausurCardProps) {
|
|
const progress = klausur.student_count
|
|
? Math.round(((klausur.completed_count || 0) / klausur.student_count) * 100)
|
|
: 0
|
|
|
|
const statusColor = klausur.status === 'completed'
|
|
? '#22c55e'
|
|
: klausur.status === 'in_progress'
|
|
? '#f97316'
|
|
: '#6b7280'
|
|
|
|
return (
|
|
<GlassCard onClick={onClick} delay={delay} className="min-h-[180px]" isDark={isDark}>
|
|
<div className="flex flex-col h-full">
|
|
<div className="flex items-start justify-between mb-3">
|
|
<h3 className={`text-lg font-semibold ${isDark ? 'text-white' : 'text-slate-900'}`}>{klausur.title}</h3>
|
|
<span
|
|
className="px-2 py-1 rounded-full text-xs font-medium"
|
|
style={{ backgroundColor: `${statusColor}20`, color: statusColor }}
|
|
>
|
|
{klausur.status === 'completed' ? 'Fertig' : klausur.status === 'in_progress' ? 'In Arbeit' : 'Entwurf'}
|
|
</span>
|
|
</div>
|
|
|
|
<p className={`text-sm mb-4 ${isDark ? 'text-white/50' : 'text-slate-500'}`}>
|
|
{klausur.subject} {klausur.semester} {klausur.year}
|
|
</p>
|
|
|
|
<div className="mt-auto">
|
|
<div className="flex justify-between text-sm mb-2">
|
|
<span className={isDark ? 'text-white/50' : 'text-slate-500'}>{klausur.student_count || 0} Arbeiten</span>
|
|
<span className={isDark ? 'text-white' : 'text-slate-900'}>{progress}%</span>
|
|
</div>
|
|
|
|
<div className={`h-2 rounded-full overflow-hidden ${isDark ? 'bg-white/10' : 'bg-slate-200'}`}>
|
|
<div
|
|
className="h-full rounded-full transition-all duration-500"
|
|
style={{
|
|
width: `${progress}%`,
|
|
background: `linear-gradient(90deg, ${statusColor}, ${statusColor}80)`,
|
|
}}
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</GlassCard>
|
|
)
|
|
}
|