ConusAI vendor v0.1.0-dev.20261027+9b1131fb
ci / gate (push) Waiting to run

This commit is contained in:
ConusAI vendor v0.1.0-dev.20261027+9b1131fb
2026-10-27 18:05:17 +00:00
commit 3102273ec7
538 changed files with 80203 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
// The labels each component takes, built from a message lookup. Every key this module's pages use
// is named here and nowhere else, so `__tests__/i18n.test.ts` can run these builders against the
// catalogues and fail on a key either language lacks.
export type Translate = (key: string, values?: Record<string, string | number>) => string
/** The status shape the labels render, declared here: ui reads no core/. */
interface StatusCounts {
documents: { queued: number; indexing: number; indexed: number; failed: number; cancelled: number }
}
export interface StatusLabels {
readonly heading: string
readonly flagOff: string
readonly state: string
readonly reasons: string
readonly indexing: string
readonly documents: string
}
export function statusLabels(t: Translate, status: StatusCounts): StatusLabels {
return {
heading: t("status.heading"),
flagOff: t("status.flagOff"),
state: t("status.state"),
reasons: t("status.reasons"),
indexing: t("status.indexing"),
documents: t("status.documents", status.documents),
}
}
export const serviceStateLabel = (t: Translate, state: string): string => {
switch (state) {
case "ready":
return t("status.stateReady")
case "indexing":
return t("status.stateIndexing")
case "registered":
return t("status.stateRegistered")
case "degraded":
return t("status.stateDegraded")
case "disabled":
return t("status.stateDisabled")
default:
return t("status.stateUnavailable")
}
}
export interface SearchFormLabels {
readonly heading: string
readonly label: string
readonly placeholder: string
readonly submit: string
readonly busy: string
readonly empty: string
readonly results: string
readonly snippet: string
readonly source: string
readonly chunk: string
readonly disclosure: string
readonly failed: string
}
export function searchFormLabels(t: Translate, failed: string): SearchFormLabels {
return {
heading: t("search.heading"),
label: t("search.label"),
placeholder: t("search.placeholder"),
submit: t("search.submit"),
busy: t("search.busy"),
empty: t("search.empty"),
results: t("search.results", { count: "{count}" }),
snippet: t("search.snippet"),
source: t("search.source"),
chunk: t("search.chunk", { chunk: "{chunk}" }),
disclosure: t("search.disclosure"),
failed,
}
}