import React from 'react'; import { Card } from '@/components/ui/card'; import { CheckSquare, Square, Folder, Music, Image as ImageIcon, File } from 'lucide-react'; import { cn } from '@/lib/utils'; import type { CloudFileNode } from './types'; export interface FileGridCardProps { file: CloudFileNode; selected: boolean; onSelect: (id: string) => void; onClick: (file: CloudFileNode) => void; isLoading?: boolean; className?: string; } function FileTypeIcon({ type, size = 'md' }: { type: CloudFileNode['type']; size?: 'md' | 'lg' }) { const cl = size === 'lg' ? 'w-8 h-8' : 'w-5 h-5'; if (type === 'folder') return ; if (type === 'audio') return ; if (type === 'image') return ; if (['document', 'archive', 'project'].includes(type)) { return ; } return ; } export function FileGridCard({ file, selected, onSelect, onClick, isLoading = false, className, }: FileGridCardProps) { if (isLoading) { return ( ); } return ( onClick(file)} > { e.stopPropagation(); onSelect(file.id); }} aria-label={selected ? 'Désélectionner' : 'Sélectionner'} > {selected ? ( ) : ( )} {file.name} {file.tags?.slice(0, 2).map((t) => ( {t} ))} ); }