diff --git a/frontend/src/components/drive/dialogs/PreviewDialog.jsx b/frontend/src/components/drive/dialogs/PreviewDialog.jsx
index 9d5b95f..d077f71 100644
--- a/frontend/src/components/drive/dialogs/PreviewDialog.jsx
+++ b/frontend/src/components/drive/dialogs/PreviewDialog.jsx
@@ -1,31 +1,63 @@
+import { useState } from 'react'
import { Button } from '@/components/ui/button'
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog'
-import { LoaderCircle, FileText, Download, RefreshCcw } from 'lucide-react'
+import { LoaderCircle, FileText, Download, RefreshCcw, Maximize2, Minimize2 } from 'lucide-react'
import { fmtSize } from '@/lib/drive-format'
-function Preview({item,url,onError}) {
+function Preview({ item, url, onError, fullscreen }) {
if (!url) return
- if (url === 'unsupported') return
Aperçu indisponible pour ce format. Tu peux le télécharger.
- const name=item?.name?.toLowerCase() || ''
- const mime=(item?.mime_type || '').toLowerCase()
- if ((mime.startsWith('image/') && mime !== 'image/svg+xml') || /\.(jpe?g|png|gif|webp|avif|bmp)$/.test(name)) return
- if (mime === 'application/pdf' || name.endsWith('.pdf')) return
- if (mime.startsWith('video/') || /\.(mp4|webm|ogv|mov|m4v)$/.test(name)) return
+ if (url === 'unsupported') return Impossible de charger l'aperçu. Tu peux réessayer ou télécharger le fichier.
+
+ const name = item?.name?.toLowerCase() || ''
+ const mime = (item?.mime_type || '').toLowerCase()
+ const mediaHeight = fullscreen ? 'max-h-full' : 'max-h-[70dvh]'
+ const frameHeight = fullscreen ? 'h-full min-h-0' : 'h-[70dvh]'
+ const textHeight = fullscreen ? 'h-full min-h-0' : 'h-[65dvh]'
+
+ if ((mime.startsWith('image/') && mime !== 'image/svg+xml') || /\.(jpe?g|png|gif|webp|avif|bmp)$/.test(name)) return
+ if (mime === 'application/pdf' || name.endsWith('.pdf')) return
+ if (mime.startsWith('video/') || /\.(mp4|webm|ogv|mov|m4v)$/.test(name)) return
if (mime.startsWith('audio/') || /\.(mp3|wav|ogg|flac|m4a|aac)$/.test(name)) return
- if (mime.startsWith('text/') || mime==='application/json' || mime==='application/xml' || /\.(txt|md|csv|json|xml|log|py|js|jsx|ts|tsx|css|html|svg)$/.test(name)) return
+ if (mime.startsWith('text/') || mime === 'application/json' || mime === 'application/xml' || /\.(txt|md|csv|json|xml|log|py|js|jsx|ts|tsx|css|html|svg)$/.test(name)) return
return Aperçu non disponible pour ce type de fichier.
}
-export default function PreviewDialog({controller: c}) {
- const {preview, setPreview, previewUrl, setPreviewUrl, download, openEntry} = c
- const close=()=>{setPreview(null);setPreviewUrl('')}
- return