Files
hermes-agent/web/src/lib/load-error-copy.ts
T
teknium1 bdc7916196 fix(ux): plain-language, actionable user-facing messages (dashboard)
Squashed integration of the user-facing message audit for this surface set.
Full per-finding receipts: /tmp/ux-audit/lanes/*-receipt.md (campaign artifacts).
2026-09-15 03:36:22 -07:00

17 lines
658 B
TypeScript

import { en } from "@/i18n/en";
/** Fill the `{what}` / `{detail}` placeholders of the "could not load" card copy.
* Kept out of the component so the copy shape is testable without rendering. */
export function loadErrorCopy(
t: { loadFailed?: string; loadFailedDetails?: string },
what: string,
detail?: string | null,
): { title: string; details: string | null } {
const loadFailed = t.loadFailed ?? en.common.loadFailed!;
const loadFailedDetails = t.loadFailedDetails ?? en.common.loadFailedDetails!;
return {
title: loadFailed.replace("{what}", what),
details: detail ? loadFailedDetails.replace("{detail}", detail) : null,
};
}