Migrate edito components

This commit is contained in:
2025-05-18 15:19:58 +02:00
parent db75bdcc89
commit bfc5cc2d29
5 changed files with 195 additions and 121 deletions

View File

@@ -1,3 +1,4 @@
import { API_BASE_URL } from '@/types/authApi';
import { IMAGE_EXTENSIONS } from '../types/file';
/**
@@ -8,3 +9,9 @@ import { IMAGE_EXTENSIONS } from '../types/file';
export const isImageFile = (filePath: string): boolean => {
return IMAGE_EXTENSIONS.some((ext) => filePath.toLowerCase().endsWith(ext));
};
export const getFileUrl = (workspaceName: string, filePath: string) => {
return `${API_BASE_URL}/workspaces/${encodeURIComponent(
workspaceName
)}/files/${encodeURIComponent(filePath)}`;
};