Phase 1 — Python (klausur-service): 5 monoliths → 36 files - dsfa_corpus_ingestion.py (1,828 LOC → 5 files) - cv_ocr_engines.py (2,102 LOC → 7 files) - cv_layout.py (3,653 LOC → 10 files) - vocab_worksheet_api.py (2,783 LOC → 8 files) - grid_build_core.py (1,958 LOC → 6 files) Phase 2 — Go (edu-search-service, school-service): 8 monoliths → 19 files - staff_crawler.go (1,402 → 4), policy/store.go (1,168 → 3) - policy_handlers.go (700 → 2), repository.go (684 → 2) - search.go (592 → 2), ai_extraction_handlers.go (554 → 2) - seed_data.go (591 → 2), grade_service.go (646 → 2) Phase 3 — TypeScript (admin-lehrer): 45 monoliths → 220+ files - sdk/types.ts (2,108 → 16 domain files) - ai/rag/page.tsx (2,686 → 14 files) - 22 page.tsx files split into _components/ + _hooks/ - 11 component files split into sub-components - 10 SDK data catalogs added to loc-exceptions - Deleted dead backup index_original.ts (4,899 LOC) All original public APIs preserved via re-export facades. Zero new errors: Python imports verified, Go builds clean, TypeScript tsc --noEmit shows only pre-existing errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
63 lines
2.3 KiB
TypeScript
63 lines
2.3 KiB
TypeScript
'use client'
|
|
|
|
import type { Rule } from '../types'
|
|
|
|
interface RulesTabProps {
|
|
rules: Rule[]
|
|
}
|
|
|
|
export function RulesTab({ rules }: RulesTabProps) {
|
|
return (
|
|
<div className="space-y-4">
|
|
<div className="flex justify-between items-center">
|
|
<h3 className="font-semibold text-slate-900">Filterregeln</h3>
|
|
<button className="px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700">
|
|
+ Regel erstellen
|
|
</button>
|
|
</div>
|
|
|
|
<div className="bg-white rounded-xl border border-slate-200 divide-y divide-slate-100">
|
|
{rules.map((rule) => (
|
|
<div key={rule.id} className="p-4 flex items-center gap-4">
|
|
<div className="text-slate-400 cursor-grab">
|
|
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
|
|
</svg>
|
|
</div>
|
|
<div className="flex-1">
|
|
<div className="font-medium text-slate-900">{rule.name}</div>
|
|
<div className="text-sm text-slate-500">
|
|
Wenn: {rule.conditions[0]?.field} {rule.conditions[0]?.operator} "{rule.conditions[0]?.value}"
|
|
</div>
|
|
</div>
|
|
<span className={`px-3 py-1 rounded text-xs font-semibold uppercase ${
|
|
rule.action_type === 'keep' ? 'bg-green-100 text-green-800' :
|
|
rule.action_type === 'drop' ? 'bg-red-100 text-red-800' :
|
|
rule.action_type === 'email' ? 'bg-blue-100 text-blue-800' :
|
|
'bg-purple-100 text-purple-800'
|
|
}`}>
|
|
{rule.action_type}
|
|
</span>
|
|
<div
|
|
className={`w-12 h-6 rounded-full relative cursor-pointer transition-colors ${
|
|
rule.is_active ? 'bg-green-500' : 'bg-slate-300'
|
|
}`}
|
|
>
|
|
<div
|
|
className={`absolute w-5 h-5 bg-white rounded-full top-0.5 transition-all shadow ${
|
|
rule.is_active ? 'left-6' : 'left-0.5'
|
|
}`}
|
|
/>
|
|
</div>
|
|
</div>
|
|
))}
|
|
{rules.length === 0 && (
|
|
<div className="p-8 text-center text-slate-500">
|
|
Keine Regeln konfiguriert
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|