| 45 | } |
| 46 | |
| 47 | function getFileIcon(name: string, type: string) { |
| 48 | if (type === "folder") return Folder; |
| 49 | const ext = name.split(".").pop()?.toLowerCase() || ""; |
| 50 | if (["ts", "tsx", "js", "jsx", "py", "sh", "bash"].includes(ext)) return FileCode; |
| 51 | if (["json", "yaml", "yml", "toml"].includes(ext)) return FileJson; |
| 52 | if (["png", "jpg", "jpeg", "gif", "webp", "svg", "ico"].includes(ext)) return Image; |
| 53 | if (["md", "mdx", "txt", "log"].includes(ext)) return FileText; |
| 54 | return File; |
| 55 | } |
| 56 | |
| 57 | function getFileColor(name: string, type: string): string { |
| 58 | if (type === "folder") return "#F59E0B"; |