import React from 'react'; import { Card } from '../Card'; import { Button } from '../Button'; import { Icon } from '../Icon'; import { Progress } from '../Progress'; import { QaheraIconName } from '../types'; export interface FileItem { id: string; name: string; type: 'folder' | 'image' | 'document' | 'video' | 'archive'; size?: string; modified?: string; icon?: QaheraIconName; } export interface FolderNode { id: string; name: string; icon?: QaheraIconName; children?: FolderNode[]; } export interface FileManagerGridProps extends React.HTMLAttributes { files: FileItem[]; folders?: FolderNode[]; storageUsed?: number; storageTotal?: number; onFileClick?: (file: FileItem) => void; onUpload?: () => void; } export function FileManagerGrid({ files, folders = [], storageUsed = 0, storageTotal = 100, onFileClick, onUpload, className = '', ...props }: FileManagerGridProps) { const storagePercent = Math.round((storageUsed / storageTotal) * 100); const iconMap: Record = { folder: 'folder', image: 'image', document: 'file', video: 'image', archive: 'folder', }; return (
{/* Sidebar */} {/* Main Grid */}
{files.map((file) => ( onFileClick?.(file)} style={{ padding: 'var(--qhr-space-4)', display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 'var(--qhr-space-2)', cursor: 'pointer', textAlign: 'center', }} > {file.name} {file.size && ( {file.size} )} ))}
); }