MCPcopy Create free account
hub / github.com/Fibi66/FeiControl / getFileIcon

Function getFileIcon

src/components/FileBrowser.tsx:47–55  ·  view source on GitHub ↗
(name: string, type: string)

Source from the content-addressed store, hash-verified

45}
46
47function 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
57function getFileColor(name: string, type: string): string {
58 if (type === "folder") return "#F59E0B";

Callers 1

FileBrowserFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected