Use folder name and file extension specific Material-icon and vscode-icon.
Inspired by vscode-icons-js and file-icons-js
npm i file-extension-icon-js
import {
getMaterialFileIcon,
getMaterialFolderIcon,
getVSIFileIcon,
getVSIFolderIcon,
} from "file-extension-icon-js";
//File Icon
<img src=`${getMaterialFileIcon('index.js')}` alt="js" width="24" />
//Folder Icon
<img src=`${getMaterialFolderIcon('android')}` alt="android" width="24" />
//Open Folder Icon
<img src=`${getMaterialFolderIcon('android', 1)}` alt="android" width="24" />
//File Icon
<img src=`${getVSIFileIcon('index.js')}` alt="js" width="24" />
//Folder Icon
<img src=`${getVSIFolderIcon('android')}` alt="android" width="24" />
//Open Folder Icon
<img src=`${getVSIFolderIcon('android', 1)}` alt="android" width="24" />