'use client' import React from 'react' import type { VocabWorksheetHook } from '../types' import { formatFileSize } from '../constants' export function UploadScreen({ h }: { h: VocabWorksheetHook }) { const { isDark, glassCard, glassInput } = h return (
{/* Existing Sessions */} {h.existingSessions.length > 0 && (

Vorhandene Sessions fortsetzen

{h.isLoadingSessions ? (
Lade Sessions...
) : (
{h.existingSessions.map((s) => (
h.resumeSession(s)} > {/* Delete Button */}
{s.status === 'extracted' || s.status === 'completed' ? ( ) : ( )}

{s.name}

{s.vocabulary_count} Vokabeln {s.status === 'pending' && ' • Nicht gestartet'} {s.status === 'extracted' && ' • Bereit'} {s.status === 'completed' && ' • Abgeschlossen'}

{s.created_at && (

{new Date(s.created_at).toLocaleDateString('de-DE', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' })}

)}
))}
)}
)} {/* Explanation */}

{h.existingSessions.length > 0 ? 'Oder neue Session starten:' : 'So funktioniert es:'}

    {['Dokument (Bild oder PDF) auswaehlen', 'Vorschau pruefen und Session benennen', 'Bei PDFs: Seiten auswaehlen die verarbeitet werden sollen', 'KI extrahiert Vokabeln — pruefen, korrigieren, Arbeitsblatt-Typ waehlen', 'PDF herunterladen und ausdrucken'].map((text, i) => (
  1. {i + 1} {text}
  2. ))}
{/* Step 1: Document Selection */}

1. Dokument auswaehlen

{/* File Upload Button */} {/* QR Code Upload Button */}
{/* Mobile Uploaded Files */} {h.mobileUploadedFiles.length > 0 && !h.directFile && ( <>
— Vom Handy hochgeladen —
{h.mobileUploadedFiles.map((file) => ( ))}
)} {/* Stored Documents */} {h.storedDocuments.length > 0 && !h.directFile && !h.selectedMobileFile && ( <>
— oder aus Ihren Dokumenten —
{h.storedDocuments.map((doc) => ( ))}
)}
{/* Step 2: Preview + Session Name */} {(h.directFile || h.selectedMobileFile || h.selectedDocumentId) && (
{/* Document Preview */}

Vorschau

{h.directFile?.type.startsWith('image/') && h.directFilePreview && ( Vorschau )} {h.directFile?.type === 'application/pdf' && h.directFilePreview && (