Add deletion of files, add slots to tree and a global icon by type. Project update needs rework.

This commit is contained in:
2024-11-20 22:51:51 +01:00
parent 4f2fc31695
commit 2855d4ba2e
10 changed files with 62 additions and 72 deletions

View File

@@ -1,3 +1,5 @@
import type { FileType } from "~/schemas/file";
export function unifySlug(slug: string | string[]): string
{
return (Array.isArray(slug) ? slug.join('/') : slug);
@@ -43,4 +45,11 @@ export function clamp(x: number, min: number, max: number): number {
if (x < min)
return min;
return x;
}
export const iconByType: Record<FileType, string> = {
'folder': 'lucide:folder',
'canvas': 'ph:graph-light',
'file': 'radix-icons:file',
'markdown': 'radix-icons:file',
}