export async function fetcher(url: string): Promise { const res = await fetch(url); if (!res.ok) { const body = await res.json().catch(() => ({})); throw new Error(body.error || `Request failed (${res.status})`); } return res.json(); }