Bus UI Evidence And Files
EvidenceLink keeps evidence actions safe.
Use it for open and download links that may also need to render as disabled text when the evidence URL is missing or denied.
Public API
EvidenceLink(p EvidenceLinkProps) gx.Node
The input model is EvidenceLinkProps. It uses
EvidenceOperation and EvidenceDenialReason to keep the
intent and the failure mode explicit.
When to use it
Use EvidenceLink when a visible link belongs to an evidence surface,
but the same control must also handle disabled states and download intent without
exposing unsafe href values.
Live demo
Example
Go API
import (
gx "github.com/busdk/bus-gx/pkg/gx"
ui "github.com/busdk/bus-ui/pkg/ui"
)
node := ui.EvidenceLink(ui.EvidenceLinkProps{
Label: "Open PDF",
Href: "/modules/accounting/evidence/bank-statement.pdf",
Operation: ui.EvidenceOperationDownload,
Download: true,
})
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 EvidenceLinkExample() gx.Node {
return <a class="evidence-link" href="/evidence/receipt.png">
<Text value={"Open receipt evidence"}></Text>
</a>
}
Use the public pkg/ui facade for this evidence link surface.