"use client"; import { X, Download } from "lucide-react"; interface DocumentViewModalProps { isOpen: boolean; onClose: () => void; document: { name: string; label: string; downloadUrl: string; size?: number; } | null; } export function DocumentViewModal({ isOpen, onClose, document }: DocumentViewModalProps) { if (!isOpen || !document) return null; const isImage = document.name?.match(/\.(jpg|jpeg|png)$/i); const isPdf = document.name?.match(/\.pdf$/i); const formatFileSize = (bytes?: number) => { if (!bytes && bytes !== 0) return ''; const k = 1024; const sizes = ['B', 'KB', 'MB', 'GB']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return Math.round(bytes / Math.pow(k, i) * 100) / 100 + ' ' + sizes[i]; }; return (
Prévisualisation non disponible pour ce type de fichier