Skip to content

Commit 6b5e480

Browse files
committed
file type helper func
1 parent e5463a1 commit 6b5e480

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spicecloud/pages/index.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ interface MetricData {
1111
readable_timestamp: string;
1212
}
1313

14+
const getFileIconSrc = (ext: string): string => {
15+
switch (ext) {
16+
case '.py': return '/python-logo.png';
17+
case '.js': return '/javascript-logo.png';
18+
case '.rb': return '/ruby-logo.png';
19+
case '.go': return '/go-logo.png';
20+
default: return '/file-icon.png';
21+
}
22+
};
23+
1424
export default function Home() {
1525
const [data, setData] = useState<MetricData[]>([]);
1626
const [selectedFile, setSelectedFile] = useState<MetricData | null>(null);

0 commit comments

Comments
 (0)