// Thin API client for the negoT8 FastAPI backend import type { Negotiation, Stats } from "./types"; const BASE = process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:8000"; async function get(path: string): Promise { const res = await fetch(`${BASE}${path}`, { cache: "no-store" }); if (!res.ok) throw new Error(`GET ${path} → ${res.status}`); return res.json() as Promise; } export const api = { stats: () => get("/api/stats"), negotiations: () => get<{ negotiations: Negotiation[]; total: number }>("/api/negotiations"), negotiation: (id: string) => get(`/api/negotiations/${id}`), analytics: (id: string) => get(`/api/negotiations/${id}/analytics`), };