/** * Abitur-Archiv Constants & Mock Data * * Extracted from page.tsx. */ // API Base URL export const API_BASE = '/api/education/abitur-archiv' // Filter constants export const FAECHER = [ { id: 'deutsch', label: 'Deutsch' }, { id: 'englisch', label: 'Englisch' }, { id: 'mathematik', label: 'Mathematik' }, { id: 'biologie', label: 'Biologie' }, { id: 'physik', label: 'Physik' }, { id: 'chemie', label: 'Chemie' }, { id: 'geschichte', label: 'Geschichte' }, ] export const JAHRE = [2025, 2024, 2023, 2022, 2021] export const NIVEAUS = [ { id: 'eA', label: 'Erhoehtes Niveau (eA)' }, { id: 'gA', label: 'Grundlegendes Niveau (gA)' }, ] export const TYPEN = [ { id: 'aufgabe', label: 'Aufgabe' }, { id: 'erwartungshorizont', label: 'Erwartungshorizont' }, ] export interface AbiturDokument { id: string dateiname: string fach: string jahr: number niveau: 'eA' | 'gA' typ: 'aufgabe' | 'erwartungshorizont' aufgaben_nummer: string status: string file_path: string file_size: number } export function getMockDocuments(): AbiturDokument[] { const docs: AbiturDokument[] = [] const faecher = ['deutsch', 'englisch'] const jahre = [2024, 2023, 2022] const niveaus: Array<'eA' | 'gA'> = ['eA', 'gA'] const typen: Array<'aufgabe' | 'erwartungshorizont'> = ['aufgabe', 'erwartungshorizont'] const nummern = ['I', 'II', 'III'] let id = 1 for (const jahr of jahre) { for (const fach of faecher) { for (const niveau of niveaus) { for (const nummer of nummern) { for (const typ of typen) { docs.push({ id: `doc-${id++}`, dateiname: `${jahr}_${fach}_${niveau}_${nummer}${typ === 'erwartungshorizont' ? '_EWH' : ''}.pdf`, fach, jahr, niveau, typ, aufgaben_nummer: nummer, status: 'indexed', file_path: '#', file_size: 250000 + Math.random() * 500000 }) } } } } } return docs } export function formatFileSize(bytes: number): string { if (bytes < 1024) return bytes + ' B' if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB' return (bytes / (1024 * 1024)).toFixed(1) + ' MB' }