MCPcopy Create free account
hub / github.com/NiladriHazra/WhatToBuild / getFileIcon

Function getFileIcon

components/RepositoryKeyFiles.tsx:14–39  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

12import { FileCode2, FileJson, FileText, Layout, Globe, Settings } from 'lucide-react';
13
14function getFileIcon(filePath: string) {
15 const extension = filePath.split('.').pop()?.toLowerCase();
16
17 switch(extension) {
18 case 'js':
19 case 'jsx':
20 case 'ts':
21 case 'tsx':
22 return <FileCode2 className="w-4 h-4 text-yellow-400" />;
23 case 'json':
24 return <FileJson className="w-4 h-4 text-green-400" />;
25 case 'md':
26 return <FileText className="w-4 h-4 text-blue-400" />;
27 case 'css':
28 case 'scss':
29 case 'sass':
30 return <Layout className="w-4 h-4 text-purple-400" />;
31 case 'html':
32 return <Globe className="w-4 h-4 text-orange-400" />;
33 case 'yml':
34 case 'yaml':
35 return <Settings className="w-4 h-4 text-gray-400" />;
36 default:
37 return <FileText className="w-4 h-4 text-gray-400" />;
38 }
39}
40import { Dialog, DialogContent, DialogHeader, DialogTitle } from './ui/dialog';
41import CodeViewer from './CodeViewer';
42

Callers 1

RepositoryKeyFilesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected