diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..3963e6d
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "static/img/icons/catppuccin-icons"]
+ path = static/img/icons/catppuccin-icons
+ url = https://github.com/catppuccin/vscode-icons/
diff --git a/src/components/Directory/Directory.tsx b/src/components/Directory/Directory.tsx
index 2358c9e..b061b3e 100644
--- a/src/components/Directory/Directory.tsx
+++ b/src/components/Directory/Directory.tsx
@@ -1,9 +1,5 @@
{/* */ }
-import { default as FolderIcon } from '@site/static/img/icons/folder.svg'
-import { default as FileIcon } from '@site/static/img/icons/file.svg'
-import { default as EnvIcon } from '@site/static/img/icons/env.svg'
-
type HighlightProp = { highlight: boolean }
interface DirectoryProps {
@@ -17,10 +13,45 @@ interface FolderProps extends HighlightProp {
interface FileProps extends HighlightProp {
name: string
+ icon?: string
}
const iconSize = 20
+const STATIC_FILENAME_ICON = {
+ ".gitignore": "git",
+ ".gitmodules": "git",
+ ".gitkeep": "git",
+ "package-lock.json": "package-json.svg",
+ "README": "readme",
+ "README.md": "readme"
+}
+
+const EXT_FILENAME_ICON = {
+ "js": "javascript",
+ "py": "python",
+ "json": "json",
+ "png": "image",
+ "html": "html",
+ "css": "css",
+ "env": "env"
+}
+
+function getIconFromName(name: string) {
+ if(STATIC_FILENAME_ICON[name]) return STATIC_FILENAME_ICON[name]
+
+ const ext = name.split(".").pop()
+ if(EXT_FILENAME_ICON[ext]) return EXT_FILENAME_ICON[ext]
+
+ return "_file"
+}
+
+function Icon({ name, width, height }) {
+ return (
+
+ )
+}
+
function Directory({ children }: DirectoryProps) {
return (