This commit is contained in:
lendry
2026-07-10 12:37:54 +03:00
parent f00f3d411d
commit 7fc3ca7952
3 changed files with 77 additions and 23 deletions

View File

@@ -1,3 +1,5 @@
import { resolveChatContentType } from '@/lib/chat-media';
const DEFAULT_MAX_EDGE = 2560;
const DEFAULT_QUALITY = 0.82;
@@ -107,7 +109,8 @@ export async function readImageDimensions(file: File) {
}
export function createFilePreviewUrl(file: File) {
if (file.type.startsWith('image/')) {
const contentType = resolveChatContentType(file);
if (contentType.startsWith('image/') || contentType.startsWith('video/')) {
return URL.createObjectURL(file);
}
return null;