'use client'; import { useRef, useState } from 'react'; interface FileDropAreaProps { onFile: (file: File) => void; onClear: () => void; accept: string; file: File | null; /** Text in der leeren Flaeche. */ placeholder: string; /** Zweite Zeile (erlaubte Formate). */ hint?: string; /** Beschriftung des Entfernen-Knopfs (fuer Screenreader). */ clearLabel: string; disabled?: boolean; } /** * Ablageflaeche fuer eine einzelne Datei (Finanzbuchhaltungs-Module, * quick-261002-fm5). Eigenstaendig, ohne Texte aus einem anderen Modul — * Bauform wie die Ablage des Zertifikat-Managers: echte Schaltflaeche fuer * Klick UND Ziehen, Entfernen als Geschwister daneben. */ export function FileDropArea({ onFile, onClear, accept, file, placeholder, hint, clearLabel, disabled = false, }: FileDropAreaProps) { const inputRef = useRef(null); const [isDragOver, setIsDragOver] = useState(false); return (
{ const picked = e.target.files?.[0]; if (picked) onFile(picked); e.target.value = ''; }} />
{file && ( )}
); }