Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const fileTree: FileTree = {
"outputs.tf": "output my_output {}",
"README.md": "# Example\n\nThis is an example.",
"install.sh": "#!/bin/bash\necho 'Installing...'",
"config.txt": "key=value",
"config.json": '{"name": "example"}',
"docker-compose.yml": "version: '3'",
Dockerfile: "FROM ubuntu:latest",
"app.py": "print('Hello')",
folder: {
"nested.tf": "resource aws_instance my_instance {}",
Expand Down
9 changes: 9 additions & 0 deletions site/src/modules/templates/TemplateFiles/TemplateFileTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import MenuItem from "@mui/material/MenuItem";
import { SimpleTreeView, TreeItem } from "@mui/x-tree-view";
import { DockerIcon } from "components/Icons/DockerIcon";
import {
BracesIcon,
ChevronDownIcon,
ChevronRightIcon,
FileCodeIcon,
FileIcon,
FolderIcon,
TerminalIcon,
} from "lucide-react";
import {
type CSSProperties,
Expand Down Expand Up @@ -100,6 +103,12 @@ export const TemplateFileTree: FC<TemplateFilesTreeProps> = ({
icon = FileTypeMarkdown;
} else if (filename.endsWith("Dockerfile")) {
icon = DockerIcon;
} else if (filename.endsWith(".sh")) {
icon = TerminalIcon;
} else if (filename.endsWith(".json")) {
icon = BracesIcon;
} else if (filename.endsWith(".yaml") || filename.endsWith(".yml")) {
icon = FileCodeIcon;
} else {
// Default icon for files without a specific icon.
icon = FileIcon;
Expand Down
Loading