Raxol.UI.Components.Harness.SpendMeter (Raxol v2.6.1)

View Source

Spend-vs-cap gauge: agent spend as a bar toward its session/lifetime cap, colored green -> yellow -> red as spend approaches the cap.

Cost and control are the same concern -- this makes overspend visible before the bill, using the same three-tier gauge idiom as Raxol.UI.Components.Harness.ContextMeter.

Summary

Types

t()

@type t() :: %{
  id: String.t() | atom(),
  spent: number(),
  cap: number(),
  width: pos_integer(),
  warn_threshold: float(),
  danger_threshold: float(),
  style: map(),
  theme: map()
}

Functions

broadcast(msg)

command(cmd)

handle_event(event, state, context)

Callback implementation for Raxol.UI.Components.Base.Component.handle_event/3.

mount(state)

Callback implementation for Raxol.UI.Components.Base.Component.mount/1.

schedule(msg, delay)

unmount(state)

Callback implementation for Raxol.UI.Components.Base.Component.unmount/1.

update(props, state)

Callback implementation for Raxol.UI.Components.Base.Component.update/2.