import { ENV_CONSTANT } from '@/constants/secrect.constant'; export function resolveMediaUrl(url?: string | null) { if (!url?.trim()) return null; const value = url.trim(); if (/^https?:\/\//i.test(value)) return value; const baseUrl = ENV_CONSTANT.BASE_API_URL?.replace(/\/$/, ''); const path = value.startsWith('/') ? value : `/${value}`; return baseUrl ? `${baseUrl}${path}` : path; }