Fix admin product image handling and clarify support phone settings.

This commit is contained in:
2026-09-16 20:04:12 +03:30
parent 2de2f697f1
commit ab5ce96529
6 changed files with 71 additions and 17 deletions
+6
View File
@@ -1,6 +1,12 @@
const MAX_EDGE = 960
const JPEG_QUALITY = 0.82
export function toCssBackgroundUrl(url: string): string {
const trimmed = url.trim()
if (!trimmed) return ''
return `url("${trimmed.replace(/"/g, '\\"')}")`
}
export async function fileToCatalogImage(file: File): Promise<string> {
if (!file.type.startsWith('image/')) {
throw new Error('فقط فایل تصویری مجاز است.')