feat: fetch root files at build step and handle double click on mobile

This commit is contained in:
2024-09-10 18:21:36 +02:00
parent ba921f0ebc
commit 3062341ce6
7 changed files with 78 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
import { DEFAULT_ICON, ICONS } from "./icons";
import { DEFAULT_ICON, ICONS, getIcon } from "./icons";
export type Icon = {
char: string;
@@ -62,7 +62,11 @@ export const link = (name: string, url: string, icon: Icon): Link => ({
icon,
});
export const file = (name: string, content: string, icon: Icon): File => ({
export const file = (
name: string,
content: string,
icon: Icon = getIcon(name),
): File => ({
type: "file",
name,
content,