The best way to control Claude Code, Codex and more from any computer or phone

main
ts 12 lines 533 Bytes
Raw
1 import { msg } from "gt-react";
2
3 import { m, type MessageResolver } from "~/i18n/messages";
4 import { PREVIEW_ERROR_CODE_MESSAGES } from "./previewConstants";
5
6 /** Components pass `useMessages()` so the message follows a language switch. */
7 export function describePreviewError(description: string, resolve: MessageResolver = m): string {
8 const friendly = PREVIEW_ERROR_CODE_MESSAGES[description];
9 if (friendly) return resolve(friendly);
10 if (description.length > 0) return description;
11 return resolve(msg("Network error"));
12 }