import React from 'react'; import { DOSSIERS } from '../constants'; import { resolvePublicUrl } from '../lib/urls'; const formatBytes = (bytes?: number) => { if (!bytes) return null; const units = ['B', 'KB', 'MB', 'GB']; let b = bytes; let i = 0; while (b >= 1024 && i < units.length - 1) { b /= 1024; i += 1; } return `${b.toFixed(i === 0 ? 0 : 1)} ${units[i]}`; }; const statusLabel = (status: string) => { switch (status) { case 'live': return 'LIVE'; case 'scheduled': return 'SCHEDULED'; case 'draft': default: return 'DRAFT'; } }; export const LeakViewer: React.FC = () => { return (
Dossiers

Current publications

{DOSSIERS.map((d) => { const isLive = d.status === 'live'; const pdfUrl = resolvePublicUrl(d.pdfPath); const evidenceUrl = resolvePublicUrl(d.evidencePath); return (
{`Cover
{d.leakDate} {d.classification} {statusLabel(d.status)} {d.id}

{d.title}

{d.summary}

Verification
{d.sha256 && isLive ? (
SHA-256
{d.sha256}
{d.bytes ? (
Size: {formatBytes(d.bytes)}
) : null}
) : (
Integrity details will publish with the drop. Until then, link verification remains staged.
)} {evidenceUrl && isLive ? ( ) : null}
Links
{pdfUrl && isLive ? ( Download PDF ) : ( PDF not published )} {d.gumroadUrl ? ( Classified edition ) : null} {d.contactEmail ? ( Contact ) : null}
{!isLive ? (
This dossier is staged. Links will activate when the drop is published.
) : null}
); })}
); };