Files
2026-11-14 09:56:45 +00:00

15 lines
776 B
TypeScript

// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
import { serviceNotice } from "@conusai-kit/ui/patterns"
import type { en } from "../i18n/en.js"
export type Messages = { [K in keyof typeof en]: string }
/**
* What the loader hands the views: the module's messages and the kit's refusal sentences by problem code
* (`businessRefusalNotices` of `@conusai-kit/business/refusals`, with this module's wording for a conflict and
* an invalid entry).
*/
export type Labels = Messages & { readonly refusals: Readonly<Record<string, string>> }
/** A remote detail never becomes untranslated or unbounded form text. */
export function describeFailure(error: unknown, labels: Labels): string {
return serviceNotice(error, labels.refusals)?.text ?? labels.unavailable
}