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:
+10
-1
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user