Show product usage types in credit ledger
Persist hotword request origin so every reservation lifecycle entry can be classified without mutating the immutable ledger.
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import type WaButton from "@awesome.me/webawesome/dist/components/button/button.js";
|
||||
import { ApiError } from "../api/client";
|
||||
import { escapeHtml } from "../lib/format";
|
||||
import type { UsageType } from "../api/types";
|
||||
import { escapeHtml, usageTypeLabel } from "../lib/format";
|
||||
|
||||
export function renderUsageTypeBadge(usageType?: UsageType): string {
|
||||
if (!usageType) return '<span class="muted">—</span>';
|
||||
return `<span class="badge usage-badge usage-badge--${escapeHtml(usageType)}">${escapeHtml(usageTypeLabel(usageType))}</span>`;
|
||||
}
|
||||
|
||||
export function renderLoading(container: HTMLElement, label = "正在加载"): void {
|
||||
container.innerHTML = `
|
||||
|
||||
Reference in New Issue
Block a user