import { useRef, useState } from 'react' interface Control { id: string control_id: string title: string } interface NewEvidenceData { control_id: string evidence_type: string title: string description: string artifact_url: string } const EVIDENCE_TYPES = [ { value: 'scan_report', label: 'Scan Report' }, { value: 'policy_document', label: 'Policy Dokument' }, { value: 'config_snapshot', label: 'Config Snapshot' }, { value: 'test_result', label: 'Test Ergebnis' }, { value: 'screenshot', label: 'Screenshot' }, { value: 'external_link', label: 'Externer Link' }, { value: 'manual_upload', label: 'Manueller Upload' }, ] function formatFileSize(bytes: number | null) { if (!bytes) return '-' if (bytes < 1024) return `${bytes} B` if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB` return `${(bytes / (1024 * 1024)).toFixed(1)} MB` } interface UploadModalProps { controls: Control[] newEvidence: NewEvidenceData setNewEvidence: (data: NewEvidenceData) => void uploading: boolean onUpload: (file: File) => void onClose: () => void } export function UploadModal({ controls, newEvidence, setNewEvidence, uploading, onUpload, onClose, }: UploadModalProps) { const fileInputRef = useRef(null) const [selectedFile, setSelectedFile] = useState(null) return (

Datei hochladen

setNewEvidence({ ...newEvidence, title: e.target.value })} placeholder="z.B. Semgrep Scan Report 2026-01" className="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-primary-500" />