Bus UI Assistant

AIApprovals renders pending decisions.

Use it for approval cards that need explicit approve and reject actions without burying decision state in the host application.

Public API

AIApprovals(p AIApprovalsProps) gx.Node

When to use it

Use AIApprovals when the assistant flow presents one or more pending requests that the operator must approve or reject before work can continue.

Key props

ID, ThreadID, Items, OnApprove, OnReject, and Attrs.

Example

Loading AIApprovals demo...

Go API

import (
  gx "github.com/busdk/bus-gx/pkg/gx"
  assistantui "github.com/busdk/bus-ui/pkg/assistantui"
)

node := assistantui.AIApprovals(assistantui.AIApprovalsProps{
  ThreadID: "thread-1",
  Items: []assistantui.AIApprovalRequest{{RequestID: "req-1", Title: "Run migration"}},
})

html, err := gx.RenderHTML(node)

.gx source

In .gx source, author the visible component state as GX markup. Keep the Go API block above for the package helper or render-boundary call.

package busuiexamples

import gx "github.com/busdk/bus-gx/pkg/gx"

func AIApprovalsExample() gx.Node {
  return <section class="approval-prompt">
  <p><Text value={"Allow the command to continue?"}></Text></p>
  <button type="button"><Text value={"Approve"}></Text></button>
  <button type="button"><Text value={"Reject"}></Text></button>
</section>
}

Related

Return to Assistant or the Bus UI reference.