bdc7916196
Squashed integration of the user-facing message audit for this surface set. Full per-finding receipts: /tmp/ux-audit/lanes/*-receipt.md (campaign artifacts).
17 lines
658 B
TypeScript
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,
|
|
};
|
|
}
|