/** * rTime applet definitions — Commitment Meter. */ import type { AppletDefinition, AppletLiveData } from "../../shared/applet-types"; const commitmentMeter: AppletDefinition = { id: "commitment-meter", label: "Commitment Meter", icon: "⏳", accentColor: "#7c3aed", ports: [ { name: "pool-in", type: "json", direction: "input" }, { name: "committed-out", type: "number", direction: "output" }, ], renderCompact(data: AppletLiveData): string { const { snapshot } = data; const committed = (snapshot.committed as number) || 0; const capacity = (snapshot.capacity as number) || 1; const pct = Math.min(100, Math.round((committed / capacity) * 100)); const label = (snapshot.poolName as string) || "Pool"; return `