Spaces:
Paused
Paused
Download client/src/components/Files/FileManager.tsx from Leon4gr45/augmenttoolkit: direct link, hf CLI and curl.
- Browser
- Download file 1.44 kB
-
https://huggingface.co/spaces/Leon4gr45/augmenttoolkit/resolve/bb4da7e5d448e08c0375f8cfd152cb4fdc024f92/client/src/components/Files/FileManager.tsx
- Command line
-
hf download hf://spaces/Leon4gr45/augmenttoolkit@bb4da7e5d448e08c0375f8cfd152cb4fdc024f92/client/src/components/Files/FileManager.tsx
-
curl -L -o FileManager.tsx https://huggingface.co/spaces/Leon4gr45/augmenttoolkit/resolve/bb4da7e5d448e08c0375f8cfd152cb4fdc024f92/client/src/components/Files/FileManager.tsx
1.44 kB
| import { useFileManager, type FileManagerProps } from './useFileManager' | |
| import { ImageLightbox } from './FileManagerImageLightbox' | |
| import { AssignModal } from './FileManagerAssignModal' | |
| import { PdfPreviewModal } from './FileManagerPdfPreviewModal' | |
| import { FileManagerToolbar } from './FileManagerToolbar' | |
| import { TrashView } from './FileManagerTrashView' | |
| import { FilesView } from './FileManagerFilesView' | |
| export default function FileManager(props: FileManagerProps) { | |
| const S = useFileManager(props) | |
| const { lightboxIndex, setLightboxIndex, imageFiles, assignFileId, previewFile, handlePaste, showTrash } = S | |
| return ( | |
| <div className="flex flex-col h-full" style={{ fontFamily: "var(--font-system)" }} onPaste={handlePaste} tabIndex={-1}> | |
| {/* Lightbox */} | |
| {lightboxIndex !== null && <ImageLightbox files={imageFiles} initialIndex={lightboxIndex} onClose={() => setLightboxIndex(null)} />} | |
| {/* Assign modal */} | |
| {assignFileId && <AssignModal {...S} />} | |
| {/* PDF preview modal */} | |
| {previewFile && <PdfPreviewModal {...S} />} | |
| {/* Toolbar */} | |
| <FileManagerToolbar {...S} /> | |
| {showTrash ? <TrashView {...S} /> : <FilesView {...S} />} | |
| <style>{` | |
| @media (max-width: 767px) { | |
| .file-actions button { padding: 8px ; } | |
| .file-actions svg { width: 18px ; height: 18px ; } | |
| } | |
| `}</style> | |
| </div> | |
| ) | |
| } | |