export const API_URL = process.env.NEXT_PUBLIC_API_URL ?? "https://localhost:7030"; export async function apiFetch(path: string): Promise { const res = await fetch(`${API_URL}${path}`, { signal: AbortSignal.timeout(8000) }); if (!res.ok) throw new Error(`${res.status} ${res.statusText}`); return res.json() as Promise; } export function assetUrl(path?: string | null): string | undefined { if (!path) return undefined; if (path.startsWith('http')) return path; return `${API_URL}${path}`; }