// File icon mappings based on file extensions const fileIconMap: Record = { // Programming languages '.js': '๐Ÿ“œ', '.jsx': 'โš›๏ธ', '.ts': '๐Ÿ“˜', '.tsx': 'โš›๏ธ', '.py': '๐Ÿ', '.java': 'โ˜•', '.c': '๐Ÿ“„', '.cpp': '๐Ÿ“„', '.cs': '๐Ÿ“„', '.php': '๐Ÿ˜', '.rb': '๐Ÿ’Ž', '.go': '๐Ÿน', '.rs': '๐Ÿฆ€', '.swift': '๐Ÿฆ‰', '.kt': '๐ŸŸฃ', // Web files '.html': '๐ŸŒ', '.htm': '๐ŸŒ', '.css': '๐ŸŽจ', '.scss': '๐ŸŽจ', '.sass': '๐ŸŽจ', '.less': '๐ŸŽจ', // Data files '.json': '๐Ÿ“Š', '.xml': '๐Ÿ“„', '.yaml': '๐Ÿ“„', '.yml': '๐Ÿ“„', '.toml': '๐Ÿ“„', '.csv': '๐Ÿ“Š', '.sql': '๐Ÿ—ƒ๏ธ', // Documentation '.md': '๐Ÿ“', '.txt': '๐Ÿ“„', '.pdf': '๐Ÿ“•', '.doc': '๐Ÿ“„', '.docx': '๐Ÿ“„', // Images '.png': '๐Ÿ–ผ๏ธ', '.jpg': '๐Ÿ–ผ๏ธ', '.jpeg': '๐Ÿ–ผ๏ธ', '.gif': '๐Ÿ–ผ๏ธ', '.svg': '๐Ÿ–ผ๏ธ', '.ico': '๐Ÿ–ผ๏ธ', '.webp': '๐Ÿ–ผ๏ธ', // Media '.mp3': '๐ŸŽต', '.mp4': '๐ŸŽฌ', '.avi': '๐ŸŽฌ', '.mov': '๐ŸŽฌ', '.wav': '๐ŸŽต', // Archives '.zip': '๐Ÿ“ฆ', '.tar': '๐Ÿ“ฆ', '.gz': '๐Ÿ“ฆ', '.rar': '๐Ÿ“ฆ', '.7z': '๐Ÿ“ฆ', // Config files '.env': 'โš™๏ธ', '.gitignore': '๐Ÿšซ', '.dockerignore': '๐Ÿšซ', '.eslintrc': '๐Ÿ“‹', '.prettierrc': '๐Ÿ“‹', // Special files 'package.json': '๐Ÿ“ฆ', 'tsconfig.json': 'โš™๏ธ', 'webpack.config.js': '๐Ÿ“ฆ', 'vite.config.js': 'โšก', 'rollup.config.js': '๐Ÿ“ฆ', 'Dockerfile': '๐Ÿณ', 'docker-compose.yml': '๐Ÿณ', 'README.md': '๐Ÿ“–', 'LICENSE': '๐Ÿ“œ', 'Makefile': '๐Ÿ”ง', }; export function getFileIcon(filename: string, isDirectory: boolean): string { if (isDirectory) { // Special folder icons if (filename === 'node_modules') return '๐Ÿ“ฆ'; if (filename === '.git') return '๐Ÿ”ง'; if (filename === 'src') return '๐Ÿ“‚'; if (filename === 'dist' || filename === 'build') return '๐Ÿ“ค'; if (filename === 'public' || filename === 'static') return '๐ŸŒ'; if (filename === 'test' || filename === 'tests') return '๐Ÿงช'; if (filename === 'docs') return '๐Ÿ“š'; return '๐Ÿ“'; } // Check for exact filename match first const exactMatch = fileIconMap[filename]; if (exactMatch) return exactMatch; // Check for extension match const lastDotIndex = filename.lastIndexOf('.'); if (lastDotIndex !== -1) { const extension = filename.substring(lastDotIndex); const icon = fileIconMap[extension]; if (icon) return icon; } // Default file icon return '๐Ÿ“„'; }