| 52 | |
| 53 | // File icon mapping based on extension |
| 54 | const getFileIcon = (entry: FileEntry) => { |
| 55 | if (entry.is_directory) return Folder; |
| 56 | |
| 57 | const ext = entry.extension?.toLowerCase(); |
| 58 | if (!ext) return File; |
| 59 | |
| 60 | // Code files |
| 61 | if (['ts', 'tsx', 'js', 'jsx', 'py', 'rs', 'go', 'java', 'cpp', 'c', 'h'].includes(ext)) { |
| 62 | return FileCode; |
| 63 | } |
| 64 | |
| 65 | // Text/Markdown files |
| 66 | if (['md', 'txt', 'json', 'yaml', 'yml', 'toml', 'xml', 'html', 'css'].includes(ext)) { |
| 67 | return FileText; |
| 68 | } |
| 69 | |
| 70 | // Image files |
| 71 | if (['png', 'jpg', 'jpeg', 'gif', 'svg', 'webp', 'ico'].includes(ext)) { |
| 72 | return FileImage; |
| 73 | } |
| 74 | |
| 75 | return File; |
| 76 | }; |
| 77 | |
| 78 | // Format file size to human readable |
| 79 | const formatFileSize = (bytes: number): string => { |