enhance(web): show attachment URL and UUID in dropzone preview (#39203)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Grigor Tonikyan
2026-09-05 10:01:27 +00:00
committed by GitHub
co-authored by wxiaoguang
parent eb501f6b19
commit bde1af541c
21 changed files with 213 additions and 102 deletions
+2 -2
View File
@@ -173,11 +173,11 @@ export function sleep(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}
export function isImageFile({name, type}: {name?: string, type?: string}): boolean {
export function isImageFile({name, type}: {name: string | null, type: string | null}): boolean {
return Boolean(/\.(avif|jpe?g|png|gif|webp|svg|heic)$/i.test(name || '') || type?.startsWith('image/'));
}
export function isVideoFile({name, type}: {name?: string, type?: string}): boolean {
export function isVideoFile({name, type}: {name: string | null, type: string | null}): boolean {
return Boolean(/\.(mpe?g|mp4|mkv|webm)$/i.test(name || '') || type?.startsWith('video/'));
}