// My Estimates (ADR-0013): list saved estimates newest-first; reopen or discard. import { listEstimates, deleteEstimate } from "./client.js"; const money = (n) => (n == null ? "—" : `$${Number(n).toFixed(2)}`); const el = (html) => { const t = document.createElement("template"); t.innerHTML = html.trim(); return t.content.firstElementChild; }; async function load() { const host = document.getElementById("estimates"); host.innerHTML = ""; const data = await listEstimates(); const estimates = data.estimates || []; document.getElementById("est-count").textContent = `${estimates.length} estimate${estimates.length === 1 ? "" : "s"}`; if (!estimates.length) { host.append( el(`
| Ref | Job | Total |
|---|