import { FileIcon, Download, ExternalLink, Copy, Check } from "lucide-react"; import { useState } from "react"; interface Evidence { id: string; test_id: string; file_name: string; sha256_hash: string; uploaded_by: string | null; uploaded_at: string; download_url?: string; } interface EvidenceListProps { evidences: Evidence[]; onDownload: (evidenceId: string) => void; } export default function EvidenceList({ evidences, onDownload }: EvidenceListProps) { const [copiedHash, setCopiedHash] = useState(null); const formatDate = (dateStr: string) => { return new Date(dateStr).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", }); }; const copyHash = async (hash: string) => { await navigator.clipboard.writeText(hash); setCopiedHash(hash); setTimeout(() => setCopiedHash(null), 2000); }; if (evidences.length === 0) { return (

No evidence files uploaded yet

); } return (
{evidences.map((evidence) => (

{evidence.file_name}

Uploaded {formatDate(evidence.uploaded_at)}

{/* SHA256 Hash */}
SHA256: {evidence.sha256_hash}
))}
); }