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

Function getFileColor

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

Source from the content-addressed store, hash-verified

55}
56
57function getFileColor(name: string, type: string): string {
58 if (type === "folder") return "#F59E0B";
59 const ext = name.split(".").pop()?.toLowerCase() || "";
60 if (["ts", "tsx"].includes(ext)) return "#60A5FA";
61 if (["js", "jsx"].includes(ext)) return "#FCD34D";
62 if (["json"].includes(ext)) return "#4ADE80";
63 if (["py"].includes(ext)) return "#93C5FD";
64 if (["md", "mdx"].includes(ext)) return "var(--text-secondary)";
65 if (["png", "jpg", "jpeg", "gif", "webp", "svg"].includes(ext)) return "#C084FC";
66 return "var(--text-secondary)";
67}
68
69function formatFileSize(bytes: number): string {
70 if (bytes === 0) return "—";

Callers 1

FileBrowserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected