feat: production tracker loads real order (markets/volume) + proper repo README

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 23:26:20 +02:00
co-authored by Claude Opus 4.8
parent 6cb7850430
commit 862c2e2651
2 changed files with 57 additions and 21 deletions
+10 -1
View File
@@ -35,6 +35,13 @@ export default function ProductionPage() {
const [feed, setFeed] = useState<{ t: string; msg: string; kind: "ok" | "run" }[]>([]);
const timer = useRef<ReturnType<typeof setInterval> | null>(null);
const tick = useRef(0);
const [order, setOrder] = useState<{ markets: string[]; volume: number } | null>(null);
useEffect(() => {
fetch(`/api/orders/${id}`)
.then((r) => (r.ok ? r.json() : null))
.then((o) => { if (o?.config) setOrder({ markets: o.config.markets ?? [], volume: o.config.volume ?? 0 }); })
.catch(() => {});
}, [id]);
const finish = () => {
setProgress([100, 100, 100, 100, 100]);
@@ -105,7 +112,9 @@ export default function ProductionPage() {
Se det hända.
</h1>
<p className="reveal delay-2 mt-5 font-mono text-sm text-muted-foreground">
Live. Källa för källa.
{order
? `${order.markets.join(" · ") || "—"} · ${new Intl.NumberFormat("sv-SE").format(order.volume)} poster`
: "Live. Källa för källa."}
</p>
</header>