renderConfidenceBadge function presentation exported ✓ 100.0%
Last updated: 2026-03-04T23:21:38.426Z
Location
Metrics
LOC: 15
Complexity: 2
Params: 3
Coverage: 100.0% (4/4 lines, 8x executed)
Signature
renderConfidenceBadge(
confidence: number | undefined,
prefix = "",
): : string
Summary
Renders a confidence progress bar with percentage label.
Source Code
export function renderConfidenceBadge(
confidence: number | undefined,
prefix = "",
): string {
const conf = confidence ?? 0;
const percent = Math.round(conf * 100);
const color = getConfidenceColor(conf);
return `
<span class="${prefix}confidence-bar">
<span class="${prefix}confidence-fill" style="width:${percent}%;background:${color}"></span>
</span>
<span style="font-size:10px;color:${color}">${percent}%</span>
`;
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| getConfidenceColor | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| renderFieldRow | calls |